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

Year Over Year Growth Calculation

Hello,

I am having difficulty trying to calculate YOY growth for my average and penetration metrics, for example, average sales. The Sales, Units, Sales PY, Units PY, Avg. Sales, and Avg. Sales PY calculate fine. The formula for them are below:

Sales = Sum(sales)

Units = Sum(units)

Sales PY = Sum({<Year={$(=only(Year)-1)}>}sales)

Units PY = Sum({<Year={$(=only(Year)-1)}>}units)

Avg. Sales = Sum(sales) / Sum(units)

Avg. Sales PY = Sum({<Year={$(=only(Year)-1)}>}sales) / Sum({<Year={$(=only(Year)-1)}>}units)

However, my Avg. Sales Growth formula does not work as expected. The formula is below:

Avg. Sales Growth = ((Sum(sales)/Sum(units)) -
(Sum({<Year={$(=only(Year)-1)}>}sales) / Sum({<Year={$(=only(Year)-1)}>}units))) /
(Sum({<Year={$(=only(Year)-1)}>}sales) / Sum({<Year={$(=only(Year)-1)}>}units))

If Avg. Sales for the current year is $3.80 and Avg. Sales PY is $3.41, Avg. Sales Growth is being calculated as 11.6%. But it should be 11.4%... how is this happening and how do I resolve? Thanks!

Labels (1)
3 Replies
Anil_Babu_Samineni

Only(Year) is something not working in your case due to there is nothing aggregate to your field where you compare. Perhaps this may will give hint

((Sum(sales)/Sum(units)) -
(Sum({<Year={$(=Max(Year-1))}>}sales) / Sum({<Year={$(=Max(Year-1))}>}units))) /
(Sum({<Year={$(=Max(Year-1))}>}sales) / Sum({<Year={$(=Max(Year-1))}>}units))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Ksrinivasan
Specialist
Specialist

hi,

try this

((Sum({<Year={$(=only(Year)-1)}>}sales) / Sum({<Year={$(=only(Year)-1)}>}units)/Sum({<Year={$(=only(Year))}>}sales) / Sum({<Year={$(=only(Year))}>}units))*100)-100.

ksrinivasan

mpalha
Contributor III
Contributor III
Author

Hi everyone,

Just an update to this that the rounding of dollar and percent value is what is causing the discrepancy. If the full number is used in the YOY calculation, it is correct.