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

2 fields - 1 Listbox

Can I have two fields in one listbox?

For example, my table look like this:

ID, name, InternalCompany, ExternalCompany

1 , Mary , McDonalds, BurgerKing

2 , Jose , BurgerKing, CoffeeStore

3, Lucas, McDonalds, CoffeeStore

I need a Listbox called Company, wich contain McDonald , BurgerKing,  CoffeeStore and when I select BurgerKing, the result look like this:

ID,      name,      InternalCompany, ExternalCompany

1 ,       Mary ,        McDonalds,                BurgerKing

2 ,      Jose ,           BurgerKing,              CoffeeStore

Help please!

6 Replies
Anonymous
Not applicable

Hi,

You will need to create a Dimension table with all of the necessary values in. In this case a concatenated load of the first table.... try this.... it will then join in ID and use Company as your list box.....

DATA:

LOAD * INLINE [

ID, name, InternalCompany, ExternalCompany

1 , Mary , McDonalds, BurgerKing

2 , Jose , BurgerKing, CoffeeStore

3, Lucas, McDonalds, CoffeeStore

];

DIMENSION:

LOAD ID,

InternalCompany as Company

Resident DATA;

CONCATENATE

LOAD ID,

ExternalCompany as Company

Resident DATA;

Cheers.

ABY.

farolito20
Contributor III
Contributor III
Author

But... How connect my dimension listbox with my fields internalcompany and externalcompany

Sent from my Windows Phone

Not applicable

Hi farolito20,

u can write an expression in the listbox as follows:

= ID & ' ' & name & ' ' & InternalCompany & ' ' & ExternalCompany

This should give you the required result

Not applicable

You can try changing your data model to :

ID, name, Company,     Type

1, Mary , McDonalds,   Internal

1, Mary , BurgerKing,  External

2, Jose , BurgerKing,  Internal

2, Jose , CoffeeStore, External

3, Lucas, McDonalds,   Internal

3, Lucas, CoffeeStore, External

Then you can have Company as the field in the list box. Selecting BurgerKing should filter the name field to Mary and Jose.

farolito20
Contributor III
Contributor III
Author

But, how connect my listbox with my table?

Not applicable

You change your data model so that it contains Company so the same field will be used for display in the report and for selection.