Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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))"}

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

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