我在Spotfire中使用数据功能。 我安装了sqldf软件包。 这是查询:
#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")
我面临的错误:
“TIBCO Spotfire Statistics Services返回错误:'错误:语句错误:接近”(“:语法错误'。”
现在要注意的是当我删除Window函数语句时,即cumu_prd_cnt字段;代码工作正常。
需要你的帮助。