Tutorials/Dictionaries/Solutions

From Kx Wiki
Jump to: navigation, search

1.

q)populations[`California]%populations`Texas
1.449344

2. max will give the largest value - then we find the key.

q)where populations=max populations
,`California

3. We could type out the keys, or use til to generate them.

q)jobs:13 14 15 16 17!("open";"closed";"pending";"cancelled";"stuck")
q)jobs:(13+til 5)!("open";"closed";"pending";"cancelled";"stuck")

4.

q)jobs:first each jobs

5. We must create single element lists, using the keyword enlist, which we saw in Tutorials/Lists.

q)d:(enlist`a)!enlist "test"

Back to Tutorials

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox