Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
mikegrattan
Creator III
Creator III

Set analysis expression to include all years

I want to modify an expression so it will include all years, and all warehouses for that matter, but it doesn't seem to be working.

Avg(Aggr(Avg({$<Year=,Warehouse=>} MinutesToLoad), SalesOrder))

The expected behavior is that my Distribution Plot chart should always include all years and all warehouses, even if selections have been  made in the app.  But, when I tested it by selecting a single year, the chart filtered to just that year.  Any ideas on what I'm doing wrong?

Thanks.

18 Replies
mikegrattan
Creator III
Creator III
Author

Still getting strange results.  Adding this expression to the data load as a new field limits the New_Warehouse values to those that are not in that list...so I'm not really sure how to use that to "not ignore the selection in New_Warehouse" and use it as a filter.  If I add New_Warehouse to a filter panel, the only options in that filter are HOL and OXN.

sunny_talwar

Sorry, this was my bad... I think you needed Match and not "Not Match"

If(Match(Warehouse, 'HUR', 'SAL', 'SSS', 'SBF', 'YUM', 'YBF', 'YSS'), Warehouse, Null()) as New_Warehouse

MK9885
Master II
Master II

Not sure if this may help since experts in Set analysis are helping you but maybe try below...

syntax may be wrong but to ignore any selections made on chart use 1 and to show all the years and warehouse regardless of selections use  "*"

Avg(Aggr(Avg({ 1 <Year={"*"}  >+< Warehouse={"*"}>} MinutesToLoad), SalesOrder))

mikegrattan
Creator III
Creator III
Author

I've updated the load script with the following:

    If(Match(Warehouse,'HUR','SAL','SSS','SBF','YUM','YBF','YSS'),Warehouse,Null()) as PFWarehouse,

(Got rid of the Master Dimension that was defined the same way).

And I'm still using the vAvgMinToLoadPerOrder variable defined as:

Avg({$<Year,PFWarehouse>}Aggr(Avg({$<Year, PFWarehouse>} MinutesToLoad), SalesOrder))

I also used the PFWarehouse dimension for my filter pane on the sheet with the chart in question. Unfortunately, I'm still getting the same behavior.

mikegrattan
Creator III
Creator III
Author

Thanks for your suggestion.  I tried it and got different behavior than noted before, but I'm still not getting all warehouses.  Instead, I'm getting the filtered warehouse, but at least I'm not getting additional noise such as a warehouse that was not filtered.

sunny_talwar

That is very strange... is it possible to share your qvf (here or through email)?

mikegrattan
Creator III
Creator III
Author

Here's a copy of the QVF.  The data that I'm looking at comes from the Cooler table, ('LOAD' status from the load sections called CoolOut 2014-2016 QVD, Cooler Outbound 2017 QVD, and Cooler Outbound 2018).  The chart I'm working on is on the Customers sheet.

Thanks.

sunny_talwar

It seems like a bug to me (or I am missing a configuration which I am not aware of).... If I convert the same chart to a table... the selection in PFWarehouse are ignored.... but not in box plot. Also, what is weird is that if I select 1 value, the box plot shows 2 warehouse... if I select 4, it will show 5.... based on the sort order. This means that it has nothing to do what what is selected... for example if you sort in ascending order and you select YUM, the chart is showing HUR and SAL... Since, I have selected YUM, I would have expected to see just YUM, if set analysis wasn't working.... it just seem to be something which is beyond my understanding.

mikegrattan
Creator III
Creator III
Author

Ok, thank you for looking at it. I'll submit it to tech support and see if it's possibly a bug.