Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
knightwriter
Creator III
Creator III

List Box Properties: Grouping?

Hi All,

If I have a list of activities in a List box, is it possible to add an expression or definition to group some activities together?

For example my current list box is:

Event - rock climbing                                         

Event - hill climbing                                           

Event - swimming

Training - presentation

Training - one to one

Outcome I want is:

Event

Training

Many thanks.

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

You can alter the list box to show the results of an expression rather than a field with this:

Untitled.png

Then bucket the values with an expression . Lots of possibilities. Here is one with wildcard matching and i threw in an 'other' category if you get unexpected values.

if(  wildmatch([FieldName],'Event*'),'Event', if( wildmatch([FieldName],'Training*','Training','Other'))

View solution in original post

8 Replies
JonnyPoole
Employee
Employee

You can alter the list box to show the results of an expression rather than a field with this:

Untitled.png

Then bucket the values with an expression . Lots of possibilities. Here is one with wildcard matching and i threw in an 'other' category if you get unexpected values.

if(  wildmatch([FieldName],'Event*'),'Event', if( wildmatch([FieldName],'Training*','Training','Other'))

b_garside
Partner - Specialist
Partner - Specialist

Most likely you will need to add a delimiter to create the hierarchy or to create a Group type column and use that instead.

The list box has a option called "Show as TreeView" its default delimiter is '/'

awhitfield
Partner - Champion
Partner - Champion

Not sure if this s was you want, first list box has expression rather than a field

=pick(wildmatch(Item, 'Event*','Training*'),

'Events', 'Training') 

knightwriter
Creator III
Creator III
Author

Great response to use an expression, thank you.

Can I use =([Activity.Type]='Event - rock climbing', 'Event',) etc?

It doesnt seem to be working?

Not applicable

Hello Stephen,

You can also create a map to a new field with these categories "grouped" if you expect these categories to grow over time, this would make it easier to maintain, not sure performance wise if would be a better solution. Please see the attached sample.

Regards,

Enrique

nagaiank
Specialist III
Specialist III

You may use the expression

=Trim(SubField(Field,'-',1))

for the listbox to get the desired outcome.

b_garside
Partner - Specialist
Partner - Specialist

If you looking for an expression type solution vs script as suggested try what NagaianK posted in his reply.

JonnyPoole
Employee
Employee

you can but you need to use nested IF()

if( [Activity.Type]='Event - rock climbing', 'Event', if ( <condition> , true result value, false result value)   )