Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
xavier2024
Contributor
Contributor

Set analysis

formula to compare the same period of this year vs last year - my year is 2023 and i want to compare sales in 2023 January 22 with the sales made in 2024 January 22

 

Labels (1)
4 Replies
MayilVahanan

Hi

Try like below, it wil give last year same day

=Sum({<Date={"$(=AddMonths(Max(Date),-12))"}>}Sales)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
xavier2024
Contributor
Contributor
Author

How can i edit the above formula to get a % change in the sales for 2023 upto 01-22 with the sales for 2024 upto 01-22

 

Rohan
Partner - Specialist
Partner - Specialist

Hi @xavier2024 ,

try this :

CY - YTD : Sum({<Date={"<=$(=date(yearstart(max(Date)))) <=$(=date(max(Date)))"}>} Sales)

PY - YTD : Sum({<Date={"<=$(=date(yearstart(max(Date),-1))) <=$(=date(addyears(max(Date),-1)))"}>} Sales)

Regards,

Rohan.

Chanty4u
MVP
MVP

Try this

(Sum({<Date={">=$(=YearStart(Max(Date), -1)) <=$(=Date(Max(Date)))"}>} Sales)

- Sum({<Date={">=$(=YearStart(Max(Date), -2)) <=$(=Date(Max(Date), -1))"}>} Sales))

/

Sum({<Date={">=$(=YearStart(Max(Date), -2)) <=$(=Date(Max(Date), -1))"}>} Sales)