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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
27 Replies
sunny_talwar
MVP
MVP

Do you have a date field in your application?

Anil_Babu_Samineni
MVP
MVP

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
MVP
MVP

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

Anil_Babu_Samineni
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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