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: 
kaikpizzi
Contributor II
Contributor II

Comparison of difference between two filters.

Good afternoon, I'm trying to make a comparison between the current period - past period / past period * 100. The goal is to obtain the variation in sales in %. For example, in my filter, I'm comparing the same period in different years: February 2023 and February 2024.

THE EXPRESSION I'M USING IS:

( ( Sum({<Ano_DC={"$(VAnoAtual_DC)"}, Mes_DC={"$(VMesAtual_DC)"}>} TOTAL_ITEM_DC) - Sum({<Ano_DC={" $(VAnoAnterior)"}, Mes_DC={"$(VMesAtual_DC)"}>} TOTAL_ITEM_DC) ) ) / Soma({<Ano_DC= {"$(VAnoAtual_DC)"}, Mes_DC={"$(VMesAtual_DC)"}> } TOTAL_ITEM_DC)

VARs
VAnoAtual_DC:
=MAX(Ano_DC)
VAnoAnterior:
=MAX(Ano_DC) -1
VMesAtual_DC:
=MAX(Mes_DC)

Labels (1)
1 Reply
WangKun
Contributor II
Contributor II

instead of using set analysis, i would suggest using inter record function like above/before like below

1- before( sum(Mes_DC={"$(VMesAtual_DC)"}> TOTAL_ITEM_DC),1)/sum(Mes_DC={"$(VMesAtual_DC)"}> TOTAL_ITEM_DC)