Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

value 2016 until today

Hello Guys,

How to change this expression bellow so it gives me the value of year -1 until today 20/10

My calendar dimension contains : Calendar Date with that format : 20/10/2017

num(sum( {$<[Year of date]={$(=Max([Year of date])-1)}>} recharge_amount),'# ##0'))

Thanks in advance

27 Replies
sunny_talwar

Do you have a date field in your application?

Anil_Babu_Samineni

What are you getting when you use this? Year(AddYears(Date(Today()),-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
mostwanted123
Creator
Creator

Try this,

num(sum( {$<[Year of date]={">= $(=Yearstart(Addyears(Max([Year of date])),-1)) <=$(=Addyears(Today()),-1)"}>} recharge_amount),'# ##0'))

Regards,

Pratik Bhor

sunny_talwar

But Anil how can you compare date to an year field brother?

Anil_Babu_Samineni

We can't with out Date field Bro

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
sunny_talwar

and that is exactly what I asked above

mostwanted123
Creator
Creator

Sorry for the extra bracket,

num(sum( {$<[Year of date]={">= $(=Yearstart(Addyears(Max([Year of date])),-1)) <=$(=Addyears(Today()),-1)"}>} recharge_amount),'# ##0')

Regards,

Pratik Bhor

master_student
Creator III
Creator III
Author

yes it's Calendar date

sunny_talwar

What is the format of this field? May be try this

Num(Sum({$<[calendar date] = {"$(='>=' & Date(AddYears(Today(), -1), 'DateFieldFormatHere') & '<=' & Date(AddYears(Today(), 0), 'DateFieldFormatHere'))}>} recharge_amount),'# ##0'))

master_student
Creator III
Creator III
Author

the format is DD/MM/YYYY