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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

AddYears in set analysis

Hi All

I have below expression where I want to subtract a year from todays date. However, it seems like the expression doesn't evaluate.

Can anyone help, I guess as usual it's something smaller detail I'm missing

Sum({$<CAL_YEAR = {$(=only(CAL_YEAR)-1)}, CAL_MONTH = {$(=Num(Max(CAL_MONTH), '00'))}, BOOKING_DATE = {"<=$(=AddYears(=date(Today(),'dd-MM-yyyy'))-1)"} >} New_NET)

Regards

Stefan

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be this

Sum({$<CAL_YEAR = {$(=only(CAL_YEAR)-1)}, CAL_MONTH = {$(=Num(Max(CAL_MONTH), '00'))}, BOOKING_DATE = {"<=$(=Date(AddYears(Today(), -1), 'DD-MM-YYYY'))"}>} New_NET)

View solution in original post

6 Replies
Anil_Babu_Samineni
MVP
MVP

May be remove = sign and Try this?

BOOKING_DATE = {"<=$(=AddYears(date(Today(),'dd-MM-yyyy'), -1))"}

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PrashantSangle
MVP
MVP

BOOKING_DATE={"<=$(=Date(addYears(Today(),-1),'DD-MM-YYYY')"},

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar
MVP
MVP

May be this

Sum({$<CAL_YEAR = {$(=only(CAL_YEAR)-1)}, CAL_MONTH = {$(=Num(Max(CAL_MONTH), '00'))}, BOOKING_DATE = {"<=$(=Date(AddYears(Today(), -1), 'DD-MM-YYYY'))"}>} New_NET)

sunny_talwar
MVP
MVP

I believe you missed a closing parenthesis

BOOKING_DATE={"<=$(=Date(addYears(Today(),-1),'DD-MM-YYYY'))"},

PrashantSangle
MVP
MVP

thanks..

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

That was easy!!!

Thanks so much. I keep learning