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: 
TomBond77
Specialist
Specialist

Bookmark with variable on calendar day

Hi experts

I built a variable for calendar day: [Calendar Day]=Date(Today()-1)

This variable is part of a bookmark. Now I need a formula which regardless of the bookmark (today-1 day) calculates a KPI over all days and not only the previous day.

Instead of the filter bookmark value '-1',  I used '0'. But this formula is not working:

avg(aggr(Sum({<"=[Calendar Day]=Date(Today()-1)"={'0'}>} Amount), [Calendar Day]))

Any ideas?

Thanks, Tom

Labels (6)
1 Solution

Accepted Solutions
TomBond77
Specialist
Specialist
Author

I solved it via this blog: https://community.qlik.com/t5/New-to-Qlik-Sense/help-with-AVG-AGGR-Count-Set-Analysis-and-ignoring-a...

 

Correct formula on my side: 

avg({<Calendar Day>} aggr(Sum({<[Product Unit]={'Cars'}, Calendar Day=>} Amount), [Calendar Day]))

View solution in original post

2 Replies
justISO
Specialist
Specialist

Hi, maybe just remove date filtering? Leave expression something like this:

avg(aggr(Sum(Amount), [Calendar Day]))

TomBond77
Specialist
Specialist
Author

I solved it via this blog: https://community.qlik.com/t5/New-to-Qlik-Sense/help-with-AVG-AGGR-Count-Set-Analysis-and-ignoring-a...

 

Correct formula on my side: 

avg({<Calendar Day>} aggr(Sum({<[Product Unit]={'Cars'}, Calendar Day=>} Amount), [Calendar Day]))