Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

set analysis ignore selection and aggr at different levels

2 questions: 

I have a fuel gauge that I want to always display the current month without the need to click on a month filter. However, I want to be able to filter by GOVERNING_GROUP and if one is selected, show the right calculation.

First, Why doesn't this expression ignore CHECKBOOK_MONTH selection?

=num((aggr(sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}AvailHours),CHECKBOOK_MONTH)
-(aggr(sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}est_np_build),CHECKBOOK_MONTH)
+aggr(sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}est_prod_build),CHECKBOOK_MONTH)
+aggr(sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}pte_design),CHECKBOOK_MONTH)))
/aggr(sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}AvailHours),CHECKBOOK_MONTH),'##.#0%')

Second, Since this is an AGGR statement, is there a way I can default to not having any GOVERNING_GROUP selected but allow the user to pick on and see the fuel gauge with that filter for the current month?

Labels (2)
1 Solution

Accepted Solutions
Kushal_Chawda

11 Replies
Kushal_Chawda

@cbaqir  what is CHECKBOOK_MONTH format?

cbaqir
Specialist II
Specialist II
Author

mm/dd/yyyy

Kushal_Chawda

@cbaqir  I don't think you need Aggr here as you are already having set on CHECKBOOK_MONTH try below

=num((sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}AvailHours)
-sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}est_np_build)
+sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}est_prod_build)
+sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}pte_design))
/sum({<CHECKBOOK_MONTH=,[CHECKBOOK_MONTH]={"$(=Date(MonthStart(Today())))"}>}AvailHours),'##.#0%')
Vegar
MVP
MVP

I agree with @Kushal_Chawda you won't need aggr for this, but if you where to use aggr then I think you will need to use the set inside the aggr as well. Like this

Aggr({your set} sum({your set}..... 

cbaqir
Specialist II
Specialist II
Author

I'm not sure I understand your syntax here.

cbaqir
Specialist II
Specialist II
Author

This is not returning any value.

cbaqir
Specialist II
Specialist II
Author

I updated CHECKBOOK_MONTH to be m/d/yyyy.

When I pick the current month and I use the aggr expression in the fuel gauge, I see 94.4% (which is correct). 191/3435 hours.

However, I still have to select the current month when it should default.

If I use the NON-aggr expression and I pick the current month, I see 100% (which is not correct). I still have to select the current month when it should default.

cbaqir
Specialist II
Specialist II
Author

I added the qvw to the first post @Kushal_Chawda @Vegar 

Kushal_Chawda

@cbaqir  see the attached