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

Percentage Growth

Hi,

I am trying to find the percentage change.

I have a slider that selects the year range. And a Line chart. I need to display the percentage change of the measure as a KPI.

What is the formula to do that?

Thanks

1 Solution

Accepted Solutions
sunny_talwar

What would be the growth number you would want to see? from 1976 to 1989? May be this

=Num(Only({<Year = {$(=MaxString(Year))}>}Population)/Only({<Year = {$(=MinString(Year))}>}Population) - 1, '##.00%')

Note: I had to use MaxString and MinString because your year field is a text, rather than a number. Convert it to number and you should be able to use Max and Min instead of MaxString and MinString

View solution in original post

7 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi,

May be like as at attached file.

Regards,

Andrey

Frank_Hartmann
Master II
Master II

for %change try with this expression:

=(Num(Population,'###,##0') - above(num(Population,'###,##0')))/(Num(Population,'###,##0'))

sqlpuzzle
Contributor III
Contributor III
Author

Andrey,

The expression you gave is very handy.

I put that expression into the Textbox object with ID 'TX01'. It showed just a -, I guess some placeholder for null values.

I am looking for getting it as a KPI in the text box. Not as another chart.

Thanks

sqlpuzzle
Contributor III
Contributor III
Author

Hi Frank,

I tried the expression in the TX01 object and it did not work. Is it a different formula for the TextBox?

Thanks

Frank_Hartmann
Master II
Master II

in a textbox you are showing only one singele value!

if you are setting up the range by slider how should the % changed be applied!

means, which % change do you want to show? from beginning of the range to the end of the range?

can u give more details?

sunny_talwar

What would be the growth number you would want to see? from 1976 to 1989? May be this

=Num(Only({<Year = {$(=MaxString(Year))}>}Population)/Only({<Year = {$(=MinString(Year))}>}Population) - 1, '##.00%')

Note: I had to use MaxString and MinString because your year field is a text, rather than a number. Convert it to number and you should be able to use Max and Min instead of MaxString and MinString

sqlpuzzle
Contributor III
Contributor III
Author

Growth% from the Start to End based on the Slider.

((Population at End Slider) - (Population at Start Slider))/ (Population at Start Slider)