Provide count distinct functionality #266
Replies: 3 comments
-
|
Good suggestion, added to backlog |
Beta Was this translation helpful? Give feedback.
-
|
use len + indexOf My customer has made 10 product purchases and I want to count how many distinct product were bought on week end only (I added week end for extra fun). source data: zen expression: result: in total 5 products were purchased on the week end |
Beta Was this translation helpful? Give feedback.
-
|
Did the API change? I'm getting an error on a local build of the editor when supplying a callback form like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have been loving the ZEN rules engine and it's ease of use. The javascript function "escape hatch" is quite nice and allows for some extensive capabilities. I will say however, the ability to count distinct elements in an array would be much appreciated.
My recommendations: if the element in the array is a "zen primitive" such as number, date, string etc it should be fairly straightforward (and perhaps that's the first support). If its a context then the user could provide a callback that returns a string of concatenated properties that make this context unique etc.
I know this can be done using javascript functions but it would be nice to be able to do
count_distinct([date, date, date])out of the box to calculate number of distinct dates for example. Orlen(distinct([date, date, date]))Beta Was this translation helpful? Give feedback.
All reactions