QlikView 9 adds a powerful new feature to Set Analysis. In 8.5, you must specify the values to be selected in a field. But how can we dynamically make selections based on another field? QlikView 9 introduces “Set Modifiers with Implicit Field Value Definitions” in section 19.4 of the reference manual. Here’s an example:
sum( {$ Customer = P({1<Product={‘Shoe’}>} Customer)>} Sales )
The expression inside P(..) is saying “Start with the complete data set and select the value “Shoe” in the Product field. The list of customers after making that selection is what I want to use to calculate sum(Sales).” Ok, that’s great. It’s dynamically generated based on selections in another field. Now we don’t need a crazy concat() expression to acheive this like we did in 8.5. And by using E(..) instead of P(..), it’s now possible for the first time to select the excluded values! That wasn’t even possible in 8.5!
But the real power is the second Customer. You do not need to return a list of values from Customer in order to make a selection on Customer.
So what? My favorite application of this new ability is in using multiple calendar tables. Let’s say you want to look at sales between two different calendar periods…
- In the pre-8.5 method, without set analysis, you were limited to sum-if logic. In order to pick two dates and calculate over two periods, both calendars needed to be unconnected from the data model. Because these tables are unconnected, other list boxes would not update as the user made date selections.
- The 8.5 approach to multi-time-period analysis has been to use bookmarks and macros. You make one period selection and bookmark it, then make the next selection. One calculation applies the bookmark, the other does not. List boxes for other dimensions continue to update as new selections are made. The user cannot see the bookmarked date selections again without applying the bookmark. The bookmark can also contain additional, unintended selections. The way to avoid this is with macro code that makes selections, which may or may not kill the server selections cache, depending on who you ask.
- THE NEW QlikView 9 way is to have two calendar tables in the data model, one connected and one unconnected. Using the new implicit selections feature we select the Possible dates in the unconnected table like so: {$Date=P({$} UnconnectedDate)>}. On the unconnected table, the user may have made selections on Year or Month or Day of Week, but we don’t care. We will select whatever UnconnectedDate values remain. By displaying both date tables we maintain visibility for both sets of date selections. Because one date table is connected, all the other fields continue to update. It is best therefore to use the connected date table as the current period and the unconnected table as the past period.
Hope you got something out of this. Cheers!
Related posts:
Pingback: Nice Read: Using multiple calendar tables | Quick - Qlear - Qool
Great explanation Jay. Regarding the connected/unconnected table, if the dummy link has zeros on both sides, wouldn’t it connect to all records? Or maybe I’m missing something. Have you posted any sample QVWs with this model?
That’s right, the dummy link needs to connect into the data model but it won’t cause any reduction. Conceptually, one of the date tables is unconnected but due to how it’s implemented it needs to connect to the data model somehow.
Pingback: Fábio Simões » Blog Archive » Set Analysis no QlikView 9
Thanks for the great explanation.
I’ve reported the ‘selection won’t propagate from data island to cloud’ issue to QlikTech support as a bug (which it is in my eyes).
The workaround works fine, and I’ve found another workaround as well: add another expression to your chart which directly references some field of the data island, and use ‘Hide Column’ on the Presentation tab to hide it. This will also trigger recalculation of the object.
That confirms it as a bug in my view. I would like QT to resolve this because it conflicts with other design decisions, such as multiple models in one QVW.
could you answer me about qlikview?
is it good in Analitical reports?
I opine that to get the personal loans from creditors you should have a good motivation. But, one time I have received a student loan, just because I wanted to buy a house.