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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ljackson
Creator
Creator

Counting number of selectors, including those with null values


I'm trying to create an expression to show the number of weeks that have been selected.   I have selected weeks 11, 12, 13 and 14, but when trying to count the total number of weeks selected (using 'count distinct') the result comes back as 2 as there are null values in 2 of the selected weeks.

One of the expressions I have tried to use (to get an answer of 4) is:

 

count(DISTINCT WeekNo) + (count(distinct(IsNull(WeekNo)))

Clearly I've got this wrong, but can't seem to work out how to correct it.  Has anyone else done this?  All I really want to know is the total number of selections, regardless of whether there are data entries or null values.

Many thanks.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you simply want the number of weeks you selected try =getselectedcount(WeekNo)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you simply want the number of weeks you selected try =getselectedcount(WeekNo)


talk is cheap, supply exceeds demand
ljackson
Creator
Creator
Author

I knew there was a simpler way ...I just couldn't find it!

Many thanks, that worked a treat.