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: 
Novarbis
Contributor II
Contributor II

Multiple set expressions in a sum if formula

Hi all,

I'm trying to create a performance dashboard for multiple countries and franchises.

My data is structured in a way so each Country contains franchises, and each franchise contains a range of products, with sales and targets. 

The countries are 'SE' , 'DK' and 'Nordic' where 'Nordic' is a group of 'SE' and 'DK'.

The franchises are 'IHD' and 'CRM'.

The products in IHD are 'ABC' and 'DEF'

The products in CRM are '123' and '456'.

In addition, there are no sales at a Nordic level. So, when Nordic is selected, the sum of the sales in DK and SE is supposed to be shown.

Load * Inline [

Franchise, Product, Country, Sales, Target

IHD, ABC,  Nordic, , 800

IHD, DEF,  Nordic, , 400

CRM, 123,  Nordic, , 500

IHD, ABC, DK, 20, 300

IHD, ABC, SE, 200, 500

IHD, DEF, DK, 25, 100

IHD, DEF, SE, 50, 300

CRM, 123, SE, 120, 250

CRM, 123, DK, 300, 250

];

I want to show sales and targets for all franchises even when one franchise is selected, and I tried with below formula for sales, but without any luck for Nordics. When I select either DK or SE it works.

So it is the combination of showing the sum of all countries and all franchises which does not work.

If(Country='Nordic',sum({<[Country]=,[Franchise]=>} Sales),sum({<Franchise=>} Sales))

I have attached the app here, which illustrates the problem.

Thanks in advance!

BR
Novarbis

Labels (3)
1 Reply
lorenzoconforti
Specialist II
Specialist II

I think the problem is with how your data is structured; if possible, I would set it up differently

See attached