Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
scw
Former Employee
Former Employee

Custom grouping in QlikSense

Hi - how do I create a custom group dynamically in QlikSense? For e.g. I have 5 countries in my Geography hierarchy USA,Canada,Mexico,Argentina and Brazil. In my dashboard I only want to see North America(USA,Canada,Mexico) and South America(Argentina and Brazil). Any ideas?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

You could use a calculated dimension as a quick and dirty solution:

=If (Match(Country,'USA', 'Canada', 'Mexico'), 'North America',

     If(Match(Country, 'Argentina', 'Brazil'), 'South America))

But a better solution is to create a mapping table to load the group as a derived field in the load script.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
SreeniJD
Specialist
Specialist

Refer this doc.. this might helps!

grouping dimension values

Sreeni

jonathandienst
Partner - Champion III
Partner - Champion III

You could use a calculated dimension as a quick and dirty solution:

=If (Match(Country,'USA', 'Canada', 'Mexico'), 'North America',

     If(Match(Country, 'Argentina', 'Brazil'), 'South America))

But a better solution is to create a mapping table to load the group as a derived field in the load script.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

To create the mapping, use an inline load before loading the main fact table:

Map_Group:

Mapping LOAD * Inline

[

     Country, Group

     USA, North America

     Canada, North America

     Mexico, North America

     Argentina, South America

     Brasil, South America

];


Then when loading the fact table:


LOAD ....

     Country,

     ApplyMap('Map_Group', Country, 'Other') As CountryGroup,

     ...


Now use CountryGroup as the first dimension in your pivot and/or add a list box for CountryGroup to your dashboard.



Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
scw
Former Employee
Former Employee
Author

Thank you for the answers above. Based on the suggestions above I created a test app and it's uploaded if you need to use it for a demo or as a starting point.