Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

1 Solution

Accepted Solutions
sunny_talwar

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

May be remove = sign and Try this?

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
PrashantSangle

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

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

I believe you missed a closing parenthesis

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

PrashantSangle

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