Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
JordyWegman
Partner - Master
Partner - Master

Challenge #2: Create an expression that respects the associative model

Challenge #2:

Set analysis often helps to control your formulas, but not always with the desired outcome. This is because set analysis overrules the selections made in an application. The challenge is to create an expression that while selecting a dimension still supports the logic of the associative model. 

The example below shows sales for different countries. Our sales representatives are active in The Netherlands, France and Belgium. The manager of these sales reps is interested in the figures, but has some extra demands. He wants two calculated columns:

  1. Total sales for each county
  2. Total sales only for The Netherlands

The manager likes Qlik for it's easy way of working and therefore needs to be able to make all selections possible and work accordingly. For instance, if the manager selects an other county than The Netherlands, The Netherlands should disappear in his table.

Check the these images for the correct behavior:

 Challenge_2_Whole_Table.png

While selecting BE in country:

Challenge_2_Selection_BE.png

If you have a solution, please post this in the comments as other people can learn from your solution!

Work smarter, not harder
Labels (2)
6 Replies
jochem_zw
Partner Ambassador
Partner Ambassador

Don't think the challenge is clear to everyone, at least not for me. I don't see why to use Set analysis in this challenge.

jochem_zw
Partner Ambassador
Partner Ambassador

ok, now the challenge is better 😉

sunny_talwar

For 2. Total sales only for The Netherlands, try this expression

Sum({<Country *= {'NL'}>} Sales)

Read about the use of * here -> Implicit Set Operators

JordyWegman
Partner - Master
Partner - Master
Author

Hi @jochem_zw ,

Thanks for the feedback! I've changed the description in order to make it more clear without giving the solution. 

Jordy

Climber

Work smarter, not harder
JordyWegman
Partner - Master
Partner - Master
Author

This is the solution for the 2nd challenge!

Work smarter, not harder
anushree1
Specialist II
Specialist II

Hi,

Please check the solution1 chart in the attachment, this can be done using an if statement as well.