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

List box for a multiple option field

I have a field that comes from multiple option data.  The multiple options have been combined into one field with the responses separated by spaces.  For example,
1     Pain FirstAid Medicine

2     FirstAid

3     Pain Medicine

4     Pain ReferGP

I would like to create a list box with the four values Pain, FirstAid, Medicine, ReferGP and then by clicking on one of the options select all records with that particular value.  For example by selecting Pain, records 1,3 and 4 would be selected, by selecting Medicine records 1 and 3 would be selected.

Does anyone know how I can do this?  I have played around with list boxes without much success.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You need to include the source field (Outcome) to provide linkage.

Load

Outcome,

  subfield(Outcome,' ') as OutcomeItem

RESIDENT Raw_Data;

-Rob

View solution in original post

5 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It's probably easiest if you separate the treatments into distinct items using subfield():

LOAD

  *

  ,subfield(Treatments, ' ') as TreatmentItem

Inline [

RecID, Treatments

1,    Pain FirstAid Medicine

2,    FirstAid

3,    Pain Medicine

4,    Pain ReferGP

]

;

Then create a listbox for TreatmentItem.

-Rob

Not applicable
Author

Hi,

Use this script

Load FieldName,SubField(FieldName,' ') as Keyword Inline [

FieldName

Pain FirstAid Medicine

FirstAid

Pain Medicine

Pain ReferGP ];

Not applicable
Author

Thanks for the prompt reply.  I tried the following

Load

  subfield(Outcome,' ') as OutcomeItem

RESIDENT Raw_Data;

and it created the fields okay but when the list box is created the selections do not work.  The link to the original data seems to have gone.  Any suggestions?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You need to include the source field (Outcome) to provide linkage.

Load

Outcome,

  subfield(Outcome,' ') as OutcomeItem

RESIDENT Raw_Data;

-Rob

Not applicable
Author

Thanks Rob.  That works.