Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sunainapawar
Creator
Creator

If condition in KPI

Hello,

I need to display the count of customer_id's wrt to Fyear. 

For example: If we have FY17/18 , FY18/19 & FY19/20 data set
Then, if current year selected FY19/20 = it should show data of FY19/20 + FY18/19 + FY17/18
if any previous year selected let say FY18/19 then it should show data only of FY18/19 & FY17/18
 ANDif year FY17/18 selected then it should show data only of FY17/18.

I tried to achieve this with below expression, but its not working. Whenever i select 2020, it shows data correctly for all years, but when i select previous year say 2019, it should show 2019 count only, but it returns count of all customer_id's. Its not evaluating the 2nd expression.

=if(
fYear=$(vMaxYear),
count({<fYear={"*"}>}distinct customer_id),
Count({<fYear={'$(vPrevYear)'}>}distinct customer_id))

Here, fyear is in 2019,2020 format. And in front end we have Financial Year selection as FY 18/19,FY 19/20..

Any help would be appreciated. Thanks in advance.

Labels (1)
0 Replies