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

CAGR issue

I would like to show the sales for each country of their least year date. each country sales started in different different years. if i select 2015, i dont want to show zero but the sales available for least date or start date.

expected output

Australia  2013 32010

China       2014 70000

Newzealand 2012 2300

Taiwan 2012 310000

attached the file. can any one help?

Thanks

Gautham

10 Replies
Not applicable

choose Country as Dimension

Use expression:

firstsortedvalue({<Year=>}Sales,Year)

tamilarasu
Champion
Champion

Hi Gautham,

Have a look at the attachment.

gauthamchilled
Creator
Creator
Author

Thanks tamil, i want to show max year sales in next column also. similar to min year sales. how can i do that?

gauthamchilled
Creator
Creator
Author

actually i wanted to calculate CAGR..it works in text box on the line chart...but i wanted to show it in straight table with country as dimension it is not working

=pow(sum({$<Year={$(=max(Year))}>} sales)/sum({$<Year={$(=min(Year))}>}

sales),1/(max(Year)-min(Year)))-1

tamilarasu
Champion
Champion

Gautham,

You can add - sign before the sort-weight to get Max Period sales.

FirstSortedValue(Sales, -Period)

gauthamchilled
Creator
Creator
Author

but i couldnt able to achieve using firstsortedvalue while calculating CAGR.

tamilarasu
Champion
Champion

Gautham,

I just want to cross verify the calculated values. Could you provide me your expected result / output for CAGR.

tamilarasu
Champion
Champion

Try this expression,

Pow((FirstSortedValue({1}Sales, -Period)/FirstSortedValue({1}Sales, Period)),1/(FirstSortedValue({1}Period, -Period)-FirstSortedValue({1}Period, Period)))-1

gauthamchilled
Creator
Creator
Author

FirstSortedValue(Country,Period) as expression and country as dimension in straight table returns nothing...what could be the reason? any idea?