New kdb+/q users question forum
Developers new to q/kdb+
cancel
Showing results for
Did you mean:

## Forum Posts

### Vector programming in q – online workshop – Sun 25 Sep

If you learned long ago to break problems into loops, writing vector solutions takes study and practice. (It is actually easier for students who have not previously learned a ‘scalar’ language.) Much more is possible than just replacing for-loops wit...

by Contributor III
• 848 Views
• 2 replies
• 3 kudos

### Resolved!Accumulators - Access additional list / column

I have a table created like below. t:([]c: 30 40 25 20 4 4; c1: 10 20 5 25 5 4) c2 is calculated Column (value from c1 or prev c2 is used based on evaluation). prev value is taken as 0 for first row / if not available Below are the calculations. c c1...

by New Contributor III
• 1141 Views
• 9 replies
• 0 kudos

### Resolved!Key value pairs in dictionary, and how to retrieve them given one?

I'm wondering on how to retrieve the key given the value of a dictionary? The way to get value given the key is array[key] - this will output the value, but what if I have the value and am looking to get the key?

by New Contributor
• 874 Views
• 3 replies
• 0 kudos

### Resolved!How to make two referencing sub-projection works?

I have below code, which doesn't work. h and g are 2 projections defined inside f, and they are referencing to each other. Theorectically, the answer should be: f[10]=g[10] =h[8] + 20 =g[5] + 30 + 20 =h[3] + 20 + 30 + 20 =g[0] + 30 + 20 + 30 + 20 =h[...

by New Contributor II
• 926 Views
• 6 replies
• 0 kudos

### Resolved!How to write local function which can be called from different levels

Hi, My code below works without error: No Error g:`;g:{[xG] xG + 2}; // global; works for f and hf:{[xF] h:{[xH] g[xH] + 3};show g[xF] + h[xF];}f[40]; // i.e. 87; no error However, I prefer a local g instead of a local one. I also tried below, but bo...

by New Contributor II
• 397 Views
• 1 replies
• 0 kudos