Spotfire : Syntax issue or Window functions not allowed?

流过昼夜 提交于 2020-01-15 09:28:30

问题


I am using Data functions in Spotfire. I have the sqldf package installed. Here is the query:

#Package to run sqls
library(sqldf)
#Input data frame
op1 <- sqldf("SELECT Prod_parnt,prodct_grop,year,month,week,
count(distinct id) as prd_cnt,
Sum(Count(distinct id))
over (partition by modlty,prodct_grop order by year,month,week
rows between 12 preceding and current row) as cumu_prd_cnt,
avg(rate) as sal_rate
FROM ip1
group by Prod_parnt,prodct_grop,year,month,week")

The error I am facing:

"TIBCO Spotfire Statistics Services returned an error: 'Error: error in statement: near "(": syntax error'."

Now the point to note here is that when I remove the Window function statement i.e cumu_prd_cnt field; the code works fine.

Need your help.

来源:https://stackoverflow.com/questions/38477963/spotfire-syntax-issue-or-window-functions-not-allowed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!