Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sharu055
Contributor III
Contributor III

YoY YTD comparison

Hi,

I am having two fields, Date & Money. having two years of data (2021,2022)

i want to make sum of Money for present year YTD in one column and Sum of Previous year same YTD as present year.

How to write he expression.. please help 

Labels (1)
1 Reply
BrunPierre
Partner - Master
Partner - Master

Sum({$<Date={"$(='>=' & Date(YearStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"},Year,Quarter,Month,Week>}Money)   // Present Year YTD

Sum({$<Date={">=$(=YearStart(Max(Date), -1))<=$(=AddYears(Max(Date), -1))"},Year,Quarter,Month,Week>}Money)   //Previous Year same period

?