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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional Count in Chart Expression

Hi,

I am trying to create a Gauge chart that will show the percentage of the total records that meet a certain condition. In this case the condition is the elapse days are less than a defined value.

I am using the following expression.

=(If([Elapsed Days]<=100,Count(DISTINCT Number))/Count(DISTINCT Number))

The issue seems to be when i have multiple records selected returned the expression does not a value. If i select a single value where [Elapsed Days] is less than 100 i get 100%. If I select a single value that is 100 or greater than [Elapsed Days] then the expression does not return a value.

Any help would be appreciated

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Instead of using

=(If([Elapsed Days]<=100,Count(DISTINCT Number))/Count(DISTINCT Number))

try this

=Count(DISTINCT if([Elapsed Days]<=100,Number))/Count(DISTINCT Number))

Thanks & Best Regards,

Kuldeep Tak

View solution in original post

1 Reply
Not applicable
Author

Hi,

Instead of using

=(If([Elapsed Days]<=100,Count(DISTINCT Number))/Count(DISTINCT Number))

try this

=Count(DISTINCT if([Elapsed Days]<=100,Number))/Count(DISTINCT Number))

Thanks & Best Regards,

Kuldeep Tak