Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression for Count Distinct All Prior Periods

count(distinct {$<Month={"<={'Apr'}"}>} Event)


what would the proper syntax be to count all distinct events before April. The expression above is returning 0.

1 Solution

Accepted Solutions
vgutkovsky
Master II
Master II

You can't compare "Apr" as a numeric value. Try this: count({<Month={"<=4"}>} distinct Event)

Regards,

Vlad

View solution in original post

4 Replies
Sokkorn
Master
Master

Hi Jonh,

You may try

count({$<Month={"<={'Apr'}"}>} distinct Event)


Regards,

Sokkorn

MK_QSL
MVP
MVP

Count(Distinct {<Month = {"<={'April'}"}>}Event)

If you want to consider for only current year, use as below

Count(Distinct {<Month = {"<={'April'}"}, Year = {'2014'}>}Event)

Not applicable
Author

Tried all of the expressions listed above and I get a 0 result back, which I know is not the case. Could there be something erroneous with specifying less than 'Apr'? 

vgutkovsky
Master II
Master II

You can't compare "Apr" as a numeric value. Try this: count({<Month={"<=4"}>} distinct Event)

Regards,

Vlad