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

Last Year Formula

Hi,

i have this formula working well, giving me the sum of Amount for the current year - which is sum from first of january till today.

I would like to have the same formula but for the prior year (2018) based on the maximum invoice date number of this year (2019). i tried to set it up, the one below but is not working. 

Anyone can help?

Formula 2018 not working: should extract Amount from the first of january 2018 till today of 1 year ago

=Sum({<Invoice_Date_Num={">=$(=Num(YearStart(Max(Invoice_Date_Num), -1)))<=$(=Num(AddYears(Max(Invoice_Date_Num), -1)))"}>}Amount)

 

Formula 2019 working well

=Sum({<Invoice_Date_Num={">=$(=Num(YearStart(Max(Invoice_Date_Num))))<=$(=Max(Invoice_Date_Num))"}>}Amount)

Labels (1)
1 Reply
Claudiu_Anghelescu
Specialist
Specialist

Try to define a variable for PY and use the variable in the Expresion Analysis.
To help community find solutions, please don't forget to mark as correct.