Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist
Specialist

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

11 Replies
Kush
MVP
MVP

@cbaqir  what is CHECKBOOK_MONTH format?

cbaqir
Specialist
Specialist
Author

mm/dd/yyyy

Kush
MVP
MVP

@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
Partner
Partner

I agree with @Kush 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}..... 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
cbaqir
Specialist
Specialist
Author

I'm not sure I understand your syntax here.

cbaqir
Specialist
Specialist
Author

This is not returning any value.

cbaqir
Specialist
Specialist
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
Specialist
Author

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

Kush
MVP
MVP