Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
harveenkaur
Contributor III
Contributor III

Growth Calculation with hierarchy

I want growth for the city sales data and along with growth for the district and state sales to which city belongs. The data must be presented in the format given below in the table.(QVF is also attached along).

Growth Formula=(CurrentYearSales-LastYearSales)/LastYearSales.

CityCity Sales GrowthDistrict Sales GrowthState Sales Growth
C1x%x%x%
C2x%x%x%
C3x%x%x%
C4x%x%x%
3 Replies
sunny_talwar

Like this?

image.png

Expressions

Sum(CurrentYearSales)/Sum(LastYearSales) - 1

Aggr(NODISTINCT Sum(CurrentYearSales), District)/Aggr(NODISTINCT Sum(LastYearSales), District) - 1

Aggr(NODISTINCT Sum(CurrentYearSales), State)/Aggr(NODISTINCT Sum(LastYearSales), State) - 1
harveenkaur
Contributor III
Contributor III
Author

Yes, it worked. Thank you.
sunny_talwar

Awesome