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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
stunelson
Contributor II
Contributor II

Retaining a KPI value after filtering

Hi, fairly new to QlikSense so any help would be appreciated.  I have a KPI which is counting the number of active services for a specific Customer, in this case the result is 14.  I also have a chart which allows me to filter the Services, when I do this the KPI updates to reflect the number of Services  selected.  I need to ensure the original value (14) is retained.

The expression in the KPI is:

=Count( {$<[SERVICE_STATUS] = {'Active'}>}Distinct Service_Number)

I think I need to somehow incorporate the Customer using the "only" expression but not sure how?

5 Replies
sunny_talwar

Try this

=Count({1<[SERVICE_STATUS] = {'Active'}>} DISTINCT Service_Number)
stunelson
Contributor II
Contributor II
Author

Hi Sunny,

This is giving me the count of Services across the dataset as opposed to a specific Customer.

sunny_talwar

I guess ignore selection in Service field in that case

=Count({$<[SERVICE_STATUS] = {'Active'}, Service>} DISTINCT Service_Number)
stunelson
Contributor II
Contributor II
Author

This now takes me back to my filtered count.

I was trying something like this but the expression is not quote correct:

=only({<Customer={1}>}count(SERVICE_STATUS={'Active'}>}Distinct Service_Number))

sunny_talwar

I don't think I follow... would you be able to share a sample where I can see the issue??