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: 
Ravi_Nagmal
Contributor III
Contributor III

Month on Month Growth % comparing current Month numbers with last Month numbers

Hi All,

Required and urgent help where I am try to get Month on Month Growth %.

I have created a pivot table as mentioned in the image where i want Growth % based on last Month (example: Jan-24 Unitcount / Dec-23 Unitcount) which should reflect below Jan-24.

Please help how can I achieve this.

 

Ravi_Nagmal_0-1708945003517.png

 

 

3 Replies
RamanaKumarChintalapati
Partner - Creator
Partner - Creator

Hi @Ravi_Nagmal ,

 

Please find the below script for your solution.

// Calculate sales for the current month

CurrentMonthSales:

LOAD

    Month,

    Sum(Sales) AS CurrentMonthSales

RESIDENT YourData

WHERE Month = Max(Month); // Select only the current month's data

 

// Calculate sales for the previous month

PreviousMonthSales:

LOAD

    Month,

    Sum(Sales) AS PreviousMonthSales

RESIDENT YourData

 

Thanks!!!

WHERE Month = Max(Month) - 1; // Select only the previous month's data

 

// Calculate the month-on-month growth percentage

MonthOnMonthGrowth:

LOAD

    *,

    If(PreviousMonthSales <> 0, ((CurrentMonthSales - PreviousMonthSales) / PreviousMonthSales) * 100) AS MonthOnMonthGrowthPercent

RESIDENT CurrentMonthSales;

Ravi_Nagmal
Contributor III
Contributor III
Author

@RamanaKumarChintalapati Thanks for the reply.

But I want to handle this at front end.

LorantPataki
Contributor III
Contributor III

Hi @Ravi_Nagmal ,

I'm using the following expression for this purpose:

(SalesValue - Before(SalesValue)) / Before(SalesValue)

just replace SalesValue with your measure or field.

https://help.qlik.com/en-US/sense/February2024/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/Inter...