Home › Forums › kdb+ › How can I replicate "each til count subs" › Re: How can I replicate "each til count subs"
-
q)tab:([] a:`a`b`c;b:1 2 3) //Create a table q)tab 0 //Index in to the table to row 0. A dictionary is returned a| `a b| 1 q)til 3 0 1 2 q)count tab // tab contains 3 rows 3 q)til count tab // 'til' returns numbers up to entered value 0 1 2 q){show tab x}each til count tab //Using 'each' and 'show' in a lambda to display each row a| `a b| 1 a| `b b| 2 a| `c b| 3
- “A simple table is a list of dictionaries” https://code.kx.com/q/learn/dicts-tables/
- https://code.kx.com/q/kb/faq/#row-indexing
- https://code.kx.com/q4m3/6_Functions/#618-anonymous-functions-and-lambda-expressions