Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
raZor
Contributor III
Contributor III

How to get LYTD

Hi Qlikers,

I want set expression for sum of sales with dates from starting of last year till end of last year last month.

So, if today is 12/07/2024

 

I want sum of sales from 01/01/2023-30/06/2023 since we are in between of current month.

 

Set expression please.

 

Regards,

Labels (5)
2 Replies
poklegoguy
Creator
Creator

Pretty sure there's a cleaner way but this will work

{$<sales_date={">=$(=YearStart(Today(),-1))<=$(=MonthEnd(AddYears(Today(),-1),-1))"}>}

TauseefKhan
Creator III
Creator III

Hi @raZor ,

Check with this:
Sum({<DateField = {">=$(=YearStart(AddYears(Today(), -1)))<=$(=MonthEnd(AddMonths(YearStart(AddYears(Today(), -1)), Month(Today())-2)))"}>} Sales)