Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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.
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.
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.
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.