Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;
@RamanaKumarChintalapati Thanks for the reply.
But I want to handle this at front end.
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.