Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Theo_Westseit
Contributor III
Contributor III

Wrong formula? Only funtion

Hello Guys,

im struggling with this formula, which is unfortunately not working:

=Only({<Month={"$num(month(If(((Today()-Monthstart(Today())))<'3',Date(Monthend(Today(),-2)),Date(Monthend(Today(),-1)))),'00')"},Year={"$num(year(If(((Today()-Monthstart(Today())))<'3',Date(Monthend(Today(),-2)),Date(Monthend(Today(),-1)))),'0000')"}>} Message)

If i replace the formula with numbers-> Month={ '05'}, Year={'2022'}, then it works perfectly...what do i need to change?
Thanks guys!

Labels (2)
1 Solution

Accepted Solutions
vchuprina
Specialist
Specialist

Hi,

Try this:

=Only({<Month={"=num(month(If(((Today()-Monthstart(Today())))<'3',Date(Monthend(Today(),-2)),Date(Monthend(Today(),-1)))),'00')"},
         Year={"=num(year(If(((Today()-Monthstart(Today())))<'3',Date(Monthend(Today(),-2)),Date(Monthend(Today(),-1)))),'0000')"}>} Message)

I've replaced $ by = and it works for me

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").

View solution in original post

2 Replies
vchuprina
Specialist
Specialist

Hi,

Try this:

=Only({<Month={"=num(month(If(((Today()-Monthstart(Today())))<'3',Date(Monthend(Today(),-2)),Date(Monthend(Today(),-1)))),'00')"},
         Year={"=num(year(If(((Today()-Monthstart(Today())))<'3',Date(Monthend(Today(),-2)),Date(Monthend(Today(),-1)))),'0000')"}>} Message)

I've replaced $ by = and it works for me

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
Theo_Westseit
Contributor III
Contributor III
Author

Thanks so much! 😀