Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sde821
Contributor II
Contributor II

Dividing two values

Hi all,

I need help to simply build a kpi where the value of a field is divided through another field.

I have this Table:

sde821_1-1700741101906.png

The value from last date of last year 104,038219 (31.12.2022) should be divided through the value of last day of the year before 108,785167 (31.12.2021). I want the KPI two adjust automatically in 2024 and all other years. How can I do this via variables, in script or front end?

Thanks for helping!

BR

Anna

 

 

Labels (1)
2 Replies
srchagas
Creator III
Creator III

create a 2 variables

1 - vMaxActualYear = Max(Your_Year_Field)

1 - vLastActualYear = Max(Your_Year_Field)-1

Then

Sum ( {< Year = , Year = {'$(vMaxActualYear )'}>} Value)

-

Sum ( {< Year = , Year = {'$(vLastActualYear )'}>} Value)

sde821
Contributor II
Contributor II
Author

Thank you for your help Srchagas, but it doesn't work. I need the quotient of the two values. 

I have a solution that is working, but I can't use a variable insted of the date. Does anyone know a way to use this formula with a variable?

Only({<[Date]={"31.12.2022"}>} Value)/Only({<DateI={"31.12.2021"}>} Value)

Thanks in advance!