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: 
Not applicable

How to restrict a measure?

Hi

Sorry if it sounds silly but i want to use a KPI to display sales for current quarter independently of what selection user make.

I tried Sum({<[Date.autoCalendar.YearQuarter]={'2017-Q1'}>}Sales) and it works.

How can I make the year-quarter value dynamic instead of fix value? I want the KPI to display current year-quarter data.

4 Replies
Anonymous
Not applicable
Author

Use a filter for YearQuarter and try use like Sum({<[Date.autoCalendar.YearQuarter]={"$(Max(YearQuarter))"}>}Sales) in the expression. Or you can even use a variable by assigning a value to it from input box.

rahulpawarb
Specialist III
Specialist III

Hello Sara,

You can try below given expression. This will show you Sales Total irrespective of current selection.

Sum({<[Date.autoCalendar.YearQuarter]={"$(=Year(Today()) & '-Q' & If(Ceil(Month(Today())/3) >=2, Ceil(Month(Today())/3)-1, Ceil(Month(Today())/3) + 3))"}>}Sales)

Hope this will be helpful.

Regards!

Rahul

satheshreddy
Creator III
Creator III

Hi Sara,

use dynamic variables in place of values.

Regards

Sathish

david_pearson
Contributor III
Contributor III

Try this

Sum({$< Date.autoCalendar.YearQuarter ={">=$(=QuarterStart(Today(),0))<=$(=Today())"}>}Sales)

 

otherwise try 

Sum({$< Date ={">=$(=QuarterStart(Today(),0))<=$(=Today())"}>}Sales