2021.09.02 11:51 AM
I have a function which takes 2 arguments. Ill write some pseudo code for an idea
f:{[x;y] $[x~`1;y;`0]}
Then i have a table:
t:([]a:`1`2`3;b:`4`5`6)
Now i want to call that function and pass a and b to it from an update statement
update c:f[a;b] from t;
update c:f[a;b] from t;
This however doesnt work because its passing the whole column instead of just an item. Now i know if it was just 1 arg i could just do an "each" but I'm not sure how to do that with 2 args.
2021.09.02 12:05 PM
You're right in using an each iterator, by using:
update c:f'[a;b] from t
a b c
-----
1 4 4
2 5 0
3 6 0
2021.09.02 12:05 PM
You're right in using an each iterator, by using:
update c:f'[a;b] from t
a b c
-----
1 4 4
2 5 0
3 6 0
2021.09.02 12:16 PM
That worked!
Thank you
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.