fav_pa
1
https://learninghub.kx.com/forums/topic/need-help-on-a-query
i have this simple table:
timestamp timeWin
--------------------
1 1 2 3
2 1 2 4 5
3 3 1 1 3 5
my goal is to modify timeWin column so that on each row, the list doesn't contain the timestamp, i.e. get that :
timestamp timeWin
--------------------
1 2 3
2 1 4 5
3 1 1 5
I know it's basic but i really can't figure it out. Thank you for your help
This should do
129200
q)t:([] timestamp:1 2 3;timeWin:(1 2 3;1 2 4 5;3 1 1 3 5))
q)update timeWin:timeWin except'timestamp from t
timestamp timeWin
-----------------
1 2 3
2 1 4 5
3 1 1 5
- except https://code.kx.com/q/ref/except/
- ' form of each https://code.kx.com/q/ref/maps/#each
q)tab:([] timestamp:1 2 3;timeWin:(1 2 3;1 2 4 5;3 1 1 3 5))
q)tab
timestamp timeWin
-------------------
1 1 2 3
2 1 2 4 5
3 3 1 1 3 5
q)update timeWin:except'[timeWin;timestamp] from tab
timestamp timeWin
-----------------
1 2 3
2 1 4 5
3 1 1 5