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: 
Aspiring_Developer
Creator III
Creator III

Calculating MOM and YOY in a qliksense KPI

Hello All,

I need to achieve below :-

1) YOY and MOM

2) Show these values in KPI and up and down arrows like below :-

Aspiring_Developer_0-1660127084169.png

I am able to calculate YOY but facing issue in MOM. PFB the expression :-

=(Sum({<Month=, Date=, Brand ={'Plusnet'},MonthName={'$(=MaxString(MonthName))'}>} Value)

-

Sum({<Brand ={'Plusnet'},Month=, Date=, MonthName={'$(=(MaxString(MonthName) -1))'}>} Value))

/


Sum({<Brand ={'Plusnet'},Month=, Date=, MonthName={'$(=MaxString(MonthName))'}>} Value)

This expression gives me in correct result and when I checked the variable values ,I found that for max month it is showing Apr-2022 but for previous month (i.e max(month)-1) gives me month in number format. Here are my fields:-

Aspiring_Developer_1-1660127307051.png

Aspiring_Developer_2-1660127343889.pngAspiring_Developer_3-1660127366707.png

Can anyone please help ? 

Thanks in advance

Labels (1)
1 Reply
Or
MVP
MVP

MaxString(MonthName)-1 is not "The month before the current month". It is the last day of the month previous to MonthName (the first of the month minus one day).

Try using AddMonths(MonthName,-1) instead, or applying MonthName(MonthName-1).