kdb+ and q
Q+A on all things kdb+ database and the q language
cancel
Showing results for 
Search instead for 
Did you mean: 

Forum Posts

Why does @ need :: and why does . need () in amend?

https://code.kx.com/q/ref/amend/Based on the above, why does . need () to get the entire list and @ need ()?Surely this would imply:q) 1 2 3 4 5 . () /this is NOT the case1 2 3 4 5 and q) list @ :: /this is NOT the caselistHowever q)list @ enlist[::]...

amend.png amend2.png
Mannix by New Contributor III
  • 299 Views
  • 1 replies
  • 0 kudos

Resolved! Why regular expression doesn't work with bracket?

I have below codes. Why the regular expression doesn't work with {2}? The last 2 lines should be 1b instead. How to make it work? Thanks. "42" like "[0-9][0-9]"; // i.e. 1b"42" like "[0-9]{2}"; // i.e. 0b "42" like "[0-9]{2,2}"; // i.e. 0b

vivo by New Contributor II
  • 367 Views
  • 2 replies
  • 0 kudos

xbar & timestamp manipulation

Hi, I have a minute table , from which I need to aggregate/process data for different intervals. In my case, as I need the equivalent of a (eg. hourly data from 10:00 to 11:00 must show on the output DT line yyyy.mm.ddD11:00:00), I use an offset va...

JP by New Contributor III
  • 549 Views
  • 2 replies
  • 0 kudos

rotate function differences between k and q

Following is the implementation of rotate function Orig: k){$[0h>@y;'`rank;98h<@y;'`type;#y;,/|(0;mod[x;#y])_y;y]} Working by making slight changes in q {$[0h>(@)y;'`rank;$[ 98h<(@)y;'`type; [ (#)y;(,/)(|)(0;mod[x;(#)y])_y;y ] ] ] } How is the strike...

Resolved! What is the difference between wj and wj1?

I have the below code, in which the result of wj and wj1 are exactly the same. Is there an example that wj and wj1 would give different output? From the documentation I can see that the 2 functions are different, but I'm not sure how to create an exa...

vivo by New Contributor II
  • 639 Views
  • 1 replies
  • 0 kudos