Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to get year on year growth for sales, cost and profit. Attached a sample file. Please help on the methodology.
The formula for yoy growth is (current year-prev year)/prev year, I don't know how to get it right in QV. Sum of sales by year and then using the formula.
Thanks
Sunny
Try:
=(sum(Sales)-Above(sum(Sales)))/Above(sum(Sales))
used this expression for Profit and Cost
Write this in first expression:
Sum(Profit)
write this in second expression :
(Sum(profit) /sum(above(column(1)))-1
Order the chart by Year Ascending.
Do similarly for sales, cost etc...
Try:
=(sum(Sales)-Above(sum(Sales)))/Above(sum(Sales))
used this expression for Profit and Cost
Hi Robert, dont I have to sort the data by year before using this formula
No as the default sort is numeric ascending
what Robert said
Hi Sunny,
The solution can be done in script or GUI. Below is a sample code.
Detail:
LOAD Date,
Sales,
Cost,
Profit
FROM
[Yoy growth.xlsx]
(ooxml, embedded labels, table is Sheet1);
YoY_Temp:
LOAD Date,
SUM(Sales) AS Sales
RESIDENT Detail
GROUP BY Date;
YoY:
LOAD Date,
Sales,
(Sales-PREVIOUS(Sales))/PREVIOUS(Sales) AS YOY_Sales
RESIDENT YoY_Temp;
Thanks,
Thanks for the response guys,
Just confused between Robert's and Umesh's response.
Robert is using Above function where Umesh is using Previous, what's the difference and which is the most apt?
Thanks
Previous works in load statement - Back end
Above in Front End - Charts
Thanks Robert, appreciate the response