using reactiveStateEngine generate array

hi, I want to generate array of values ​​​​​​like :- [value, move( value,1) , move( value,2) , move( value,3) , move(value,4)] using reactiveStateEngine

please provide me code for this using reactiveStateEngine

input = table(100:0, `index`symbol`value, [INT,SYMBOL,INT])

output = define table with columns of index, symbol, value and array.

picture for better understanding:

    given input:-                                                            required output:-       

attachments-2022-02-lS6ITSsh61fe8273bfda8.png

Reply as soon as possible.

请先 登录 后评论

最佳答案 2022-02-09 10:53

In SQL, you could use fixedLengthArrayVector function to do this.


t1 = table(take(2020.01.01,18) as date1,1 2 3 1 2 3 4 4 5 5 6 7 8 9 6 7 8 9 as index, `A`A`A`B`B`B`A`B`B`A`A`A`A`A`B`B`B`B as symbol, 4 7 1 8 7 4 5 7 4 8 7 6 9 8 7 5 4 1 as value)
t2= select index, symbol, value,fixedLengthArrayVector(value,move(value,1),move(value,2),move(value,3),move(value,4)) as v1 from t1 context by symbol

In reactiveStateEngine, somehow, it did not support this function for now. Next version will support this function.


请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,1085 浏览
  • Vishvesh Upadhyay 提出于 2022-02-05 22:00

相似问题