2 weeks ago
Which form of iterator is being used here? Thank you!
https://code.kx.com/q4m3/A_Built-in_Functions/#a88-ssr
You can use the over
iterator with ssr
to replace multiple items.
(ssr/)["results_%div_%dept.csv"; ("%div";"%dept"); ("banking";"m&a")]
2 weeks ago
https://code.kx.com/q/ref/accumulators/#ternary-values
You can use a sample to see how it progresses:
({-1 .Q.s1 `x`y`z!(x;y;z);x+y+z}/)[0;1 2 3;4 5 6]
`x`y`z!0 1 4
`x`y`z!5 2 5
`x`y`z!12 3 6
21
And on the ssr
example:
({-1 .Q.s1 `x`y`z!(x;y;z);ssr[x;y;z]}/)["results_%div_%dept.csv"; ("%div";"%dept"); ("banking";"m&a")]
`x`y`z!("results_%div_%dept.csv";"%div";"banking")
`x`y`z!("results_banking_%dept.csv";"%dept";"m&a")
"results_banking_m&a.csv"
2 weeks ago
https://code.kx.com/q/ref/accumulators/#ternary-values
You can use a sample to see how it progresses:
({-1 .Q.s1 `x`y`z!(x;y;z);x+y+z}/)[0;1 2 3;4 5 6]
`x`y`z!0 1 4
`x`y`z!5 2 5
`x`y`z!12 3 6
21
And on the ssr
example:
({-1 .Q.s1 `x`y`z!(x;y;z);ssr[x;y;z]}/)["results_%div_%dept.csv"; ("%div";"%dept"); ("banking";"m&a")]
`x`y`z!("results_%div_%dept.csv";"%div";"banking")
`x`y`z!("results_banking_%dept.csv";"%dept";"m&a")
"results_banking_m&a.csv"
2 weeks ago
Thank you very much! May I ask where is the documentation on "-1" used here?
2 weeks ago - last edited 2 weeks ago
1 means send to stdout
-1 means send to stdout, then append a newline character
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.