Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
An issue has been identified on Qlik Cloud hub, please visit our Status Update Page for details: GET THE LATEST
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
laddu_927
Specialist
Specialist

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