Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
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)