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

Difference and variance formulas in KPI

Hello, im incorporating in the subtitle and footnote of a KPI (that is comparing the sell of units between one year and another) the difference (quantity) and variance (% change) of the two figures presented. Im using the next formulas to calculate difference and variance, but unfortunately they are not working:

='DIF = '& NUM((NUM(Median({$<AÑO={$(=max([AÑO]))}>}[Margen VI]),'#')-NUM(Median({$<AÑO={$(=max([AÑO])-1)}>}[Margen VI]),'#')),'#,#0')

='VARIACIÓN = '& NUM((([MARGEN 4 N]-[MARGEN 4 N-1])/[MARGEN 4 N-1]),'#,#%')

If anyone could help me regarding this issue I will really appreciated as im knew in Qlik Sense.

1 Solution

Accepted Solutions
sunny_talwar

May be try this

='DIF = '& Num(Median({$<AÑO={$(=Max([AÑO]))}>} [Margen VI]) - Median({$<AÑO = {$(=Max([AÑO])-1)}>} [Margen VI]), '#,#0')

This looks good if MARGEN 4 N and MARGEN 4 N-1 will always only have single values

='VARIACIÓN = ' & Num((([MARGEN 4 N]-[MARGEN 4 N-1])/[MARGEN 4 N-1]), '#,#%')

View solution in original post

1 Reply
sunny_talwar

May be try this

='DIF = '& Num(Median({$<AÑO={$(=Max([AÑO]))}>} [Margen VI]) - Median({$<AÑO = {$(=Max([AÑO])-1)}>} [Margen VI]), '#,#0')

This looks good if MARGEN 4 N and MARGEN 4 N-1 will always only have single values

='VARIACIÓN = ' & Num((([MARGEN 4 N]-[MARGEN 4 N-1])/[MARGEN 4 N-1]), '#,#%')