problem with msum

This is my code:


x=table(rand(12,20) as data, take(1..20,20) as m, take(3 4 5 6 2,20) as w)

select msum(data,w) from x

select msum(data,(mod(m,5)+2)) from x


Whenever I use msum, it gives me error "Usage: msum(X, window, [minPeriods]). window must be at least 2"

Please help me as soon as possible.

请先 登录 后评论

1 个回答

Eva

Hi there, I am not very sure what you are achieving here, but the correct usage of 'msum' function is that the 'window' parameter can only take either a positive integer or a type of 'duration': https://www.dolphindb.com/help/FunctionsandCommands/FunctionReferences/d/duration.html

You can also resort to the link below for more examples of 'msum' function. 

https://www.dolphindb.com/help/FunctionsandCommands/FunctionReferences/m/msum.html

Let me know if that helps. 


请先 登录 后评论
  • 1 关注
  • 0 收藏,969 浏览
  • Vishvesh Upadhyay 提出于 2022-01-05 18:12

相似问题