-
Using the partition type as a parameter
Hi all,
I have a date-partitioned table called Orders, and am looking to get the number of rows for a certain date, within a lambda.
Would anyone be able to shed some light on the below, the type error and the result = 0 cases? It looks like using date as a parameter is causing an issue when we’ve loaded a date-partitioned database, but would be good to understand the first two results.
q)// Using 4.0 2020.06.18
q)
q){[t;date] ?[t;enlist(=;
date;date);0b;(enlist
cnt)!enlist(count;i)]}[
Orders;2024.07.15]'type
[1] {[t;date] ?[t;enlist(=;
date;date);0b;(enlist
cnt)!enlist(count;i)]}</p><p> ^</p><p>q))\</p><p>q){[t;date] ?[t;enlist(=;
date;enlist date);0b;(enlistcnt)!enlist(count;
i)]}[Orders;2024.07.15]</p><p>cnt</p><p>---</p><p>0</p><p>q){[t;dt] ?[t;enlist(=;
date;dt);0b;(enlistcnt)!enlist(count;
i)]}[`Orders;2024.07.15]cnt
--------
86618327
Log in to reply.