Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikmpate0
Creator II
Creator II

List box - Selectors help

Hi,

I have a table containing rows of different brands eg:-

Brand1

Brand2

Brand3

When doing a list box for brands I see all brands, but I would like to group Brand1 and Brand2 as 'Education' and Brand3 as 'Games'.

can anyone help. Apologies if I haven't given all the information.

regards

M

7 Replies
MK_QSL
MVP
MVP

Use Below Expression to create list box

IF(Brand = 'Brand1' or Brand = 'Brand2', 'Education', If(Brand = 'Brand3', 'Games'))

senpradip007
Specialist III
Specialist III

Use this.

LOAD *, If(match(Brand,'Brand3'), 'Games', 'Education') as Category  Inline [

Brand

Brand1

Brand2

Brand3

];

stigchel
Partner - Master
Partner - Master

You can do this best in load script e.g. using a mapping load, something like

MyMap:

Mapping load [From, To

Brand1, Education

Brand2, Education

Brand3, Games

];


Load

....

Brand

Applymap('MyMap',Brand) as MyGroup

....

From Source

florentina_doga
Partner - Creator III
Partner - Creator III

use expression in list box

=if(brand='Brand1' or brand='Brand2', 'Education', 'Games')

qlikmpate0
Creator II
Creator II
Author

would this be slower?

qlikmpate0
Creator II
Creator II
Author

If I add it into the script it will be quicker?  the added complication Ihave is that I'm using and ApplyMap to get the initial brand name too.

stigchel
Partner - Master
Partner - Master

I try to avoid these nested ifs, the impact varies with the amount of data and two of those nested if's won't have that much effect, but I'm guessing there are more then those three?

Next to performance, there is also maintainbility. You could have the mapping load in an easy to maintain excel file

See also

Data Cleansing