Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sunilkumar3
Contributor III
Contributor III

Regarding the Multiple Expression in the KPI

Hi,

I want. to show Multiple Expression in the KPI.

Example:

By default :-

Sum({<Flag = {'YTD'}>}Sales)

if  Month_year  Dimension  Selected then Sum(Sales)

So how to write the Expression in the KPI 

 

Thanks & Regards,

Sunil Kumar

 

Labels (2)
1 Solution

Accepted Solutions
mominh_uzaifa
Contributor II
Contributor II

Hello

Try this

if(GetSelectedCount(Month_year)>0,Sum(Sales),Sum({<Flag = {'YTD'}>}Sales))

Thanks & Regards,

Huzaifa Momin

View solution in original post

2 Replies
mominh_uzaifa
Contributor II
Contributor II

Hello

Try this

if(GetSelectedCount(Month_year)>0,Sum(Sales),Sum({<Flag = {'YTD'}>}Sales))

Thanks & Regards,

Huzaifa Momin

sarafoster
Contributor
Contributor

You can use the "if" function to create a conditional expression in your KPI that displays the YTD sales when the "Flag" dimension is selected, and the monthly sales when the "Month_year" dimension is selected. Here's an example expression:

if(GetSelectedCount(Flag) > 0, Sum({<Flag={'YTD'}>}Sales), if(GetSelectedCount(Month_year) > 0, Sum(Sales), 0))

This expression checks if either "Flag" or "Month_year" dimensions are selected, and based on that, calculates the corresponding sales value. If neither of these dimensions are selected, it will return a value of 0.   UMR.com