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: 
arnould_it
Contributor III
Contributor III

Previous YTD, until the end of current month


I have to calculate the sum of sales based on the YTD for the PREVIOUS YEAR, but not until today: I have to consider the last day of the current month for the previous year.

Example: Today is 05/06/2019 -> so I have to sum up the sales starting from 01/01/2018 until 30/06/2018.

What is the best way to do it?

Thanks in advance

Alessandro
Labels (2)
12 Replies
OmarBenSalem

same as we did, juste replace max(Date) by today(1)

arnould_it
Contributor III
Contributor III
Author

This seems work:

Sum({<date={">=$(=date(YearStart(AddYears(Max(date),-1)),'YYYY-MM-DD'))<=$(=date(addmonths(MonthEnd(Today()),-12),'YYYY-MM-DD'))"}>}importo_netto)

Date starts from 01/01/2018 until 30/06/2018

 

arnould_it
Contributor III
Contributor III
Author

Thank you Omar

Have a nice day

Alessandro