Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
QS21
Contributor III
Contributor III

How to create KPI chart with Month condition

Hi All,

I am facing a challenge with the KPI chart, Text and image and multi KPi chart. basically I tried all KPi charts.

I am trying to create a dynamic commentary im my report using text and image chart where we can write text and also add measure next to it. while doing so I am trying to write comments comparing current month to last month like below:

The BOLD ones below are measures.

"Max(sale) current month is 100, Min Sales Current month is 50 where variance between max and min sales DECREASED compared to last month "

If I do not apply any month condition in the measure it show overall value. If I apply month condition, it does not display any value. and the "INCREASED, DECREASED" part is not at all working as it has condition that involves current month and last month. Someone please help. 

Logic is working fine when I put it in a table or any other chart.

IF(
IF(Monthname(MTH)=MonthName(today(),-2),(max(total <NAME> aggr( Avg(Sales),NAME,MTH))
- min(total <NAME> aggr( Avg(SALES),NAME,MTH))))
>
IF(Monthname(MTH)=MonthName(today(),-3),(max(total <NAME> aggr( Avg(SALES),NAME,MTH))
- min(total <NAME> aggr( Avg(SALES),NAME,MTH))))
,'INCREASED','DECREASED')

 

Please help!

1 Reply
dmac1971
Creator III
Creator III

Hi, I think I understand what you are trying to achieve here.  Why not use Max(Month) vs Max(Month)-1 here instead though, this way you can isolate months in filters etc and the calculation will still work.  I would also ask are you using a master calendar, if not you should.