user11726509
user11726509

Reputation: 47

How to skip a loop in kdb?

I have the following

mydata:raze {[x]

L: select from .... 

if[count[L] <= 20; continue]

} peach vals;

and I am trying to add an if-statement that would skip a particular entry in vals if the condition is not met. continueworks well in matlab, but, I am not sure of the corresponding syntax in kdb. Thank you.

Upvotes: 0

Views: 339

Answers (1)

Jorge Sawyer
Jorge Sawyer

Reputation: 1341

You can use an explicit return (:) in the if statement to return an empty list for those cases. Something like:

mydata:raze {[x]

L: select from .... 

if[count[L] <= 20; :()]

} peach vals;

Upvotes: 1

Related Questions