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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Issue in expression- last year MTD

Hi Friends

I am using below expression to get last year MTD.

Example , if today is 10th, then we should get Oct 1st 2017 to 10th 2017. However using below expression is giving me 0.

sum( {<Year=,Month=,Date={">=$(=AddYears(MonthStart(max(Date)),-1)) <=$(=AddYears(max(Date),-1))"} >}   SALES)



Kindly help to resolve the issue in above expression.




Thanks & Regards

Chintan Gala


10 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Then simply check if it works with either one switch between:

1. =Date(AddYears(MonthStart(Today()), -1), 'YYYY.MM.DD')

2. =Date(AddYears(Today(), -1), 'YYYY.MM.DD')

Check if the Date and SALES fields are named the same in the script.

Check if Date formatting is correct 'YYYY.MM.DD'.


Simple play & debug the sentence till you understand what's wrong.