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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dmitroika
Contributor
Contributor

How to use a default value for a KPI calculation if nothing is selected

Hi Guys,

Please I urgently need assistance with the following problem:

I am looking for a solution to use for a KPI calculation if nothing is selected.

E.g: the KPI must display a selected country's sales data (e.g Poland) if no country is selected. However, if a country is selected then that country's data should then be displayed.

I tried the following expression but I receive an error message: Nested aggregation not allowed.


If(GetSelectedCount([Country]=0,

sum({<[Country]={'Poland'}>}[Sales]),

sum([Sales]))

 

Thank you!

1 Solution

Accepted Solutions
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi,


Small formula fix missing ')':

=IF(GetSelectedCount([Country])=0,
sum({<[Country]={'Poland'}>} [Sales]),
sum([Sales]))

 

Kind regards,

S.T. 

View solution in original post

2 Replies
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi,


Small formula fix missing ')':

=IF(GetSelectedCount([Country])=0,
sum({<[Country]={'Poland'}>} [Sales]),
sum([Sales]))

 

Kind regards,

S.T. 

dmitroika
Contributor
Contributor
Author

Thanks S.T. 

It worked!