Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
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)