0

This basic cond works :

$[8i > 3i ; true;false]

but this does not:

$[mm$.z.d > 3i ; true;false]

I don't understand why, since mm$.z.d (current month) is 8i.

Vipin CP
  • 3,642
  • 3
  • 33
  • 55
Sithered
  • 481
  • 7
  • 23

1 Answers1

2

kdb reads right-to-left, thus it's comparing

.z.d>3i 

before it ever gets to the month casting. You need to use parentheses to force the casting first

q)$[(`mm$.z.d) > 3i ;`true;`false]
`true

or better yet, refactor your statement to allow for the right-to-left

q)$[3i<`mm$.z.d;`true;`false]
`true
terrylynch
  • 11,844
  • 13
  • 21