Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am new to qlikview and i want to calculate the clean profits from the previous year to day versus year to day having the below data and their differences.
DATE
VALUE
31/01/2022
100,00 €
31/01/2023
150,00 €
28/02/2022
101,00 €
28/02/2023
31/03/2022
102,00 €
31/03/2023
90,00 €
30/04/2022
103,00 €
30/04/2023
80,00 €
31/05/2022
104,00 €
31/05/2023
20,00 €
30/06/2022
105,00 €
30/07/2022
31/08/2022
107,00 €
30/09/2022
108,00 €
31/10/2022
109,00 €
30/11/2022
110,00 €
31/12/2022
111,00 €
RESULT
pytd
ytd
Diff%
510,00 €
490,00 €
Hi
Try like below,
Hope you have Year field
YTD =Sum({<Year={$(=Max(Year))}>}VALUE)
PYTD =Sum({<Year={$(=Max(Year)-1)}, Date={"<=$(=AddYears(Max(Date),-1))"}>}VALUE)