Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create listbox based on concatenation of string & value selected in another listbox

Hello,

I have a listbox titled Category with with values B and M. In my data I have 4 columns B_Country, B_Region, M_Country, M_Region.

I want to create a dynamic listbox which will show countries belonging to B_Country for B_Region = 'EU' when B is selected in listbox titled Category.The same logic applies when I select M.

I created a listbox and defined the rule in field expression as: =If('$(=Category)'&'_Region' = 'EU', '$(=Category)'&'_Country')

But it's not working.

Can you please help me in resolving this?

Regards,

Ayandeep

11 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

I'm not entirely sure what the IF condition is for, but try to create a real field name in the THEN part, instead of a string.


=If([$(=Category)_Region] = 'EU', [$(=Category)_Country])


Nevermind the warnings that the expression editor will give you. Both the syntax checker in the Script Editor as well as the one in the Expression editor are incapable of handling live field name deduction.


[Edit] Fixed the IF condition as well, since it had the same problem

Not applicable
Author

Hi Peter,

I tried using the expression you have mentioned but unfortunately it's not working.

Regards,

Ayandeep

Anonymous
Not applicable
Author

Could you post a sample data?

Not applicable
Author

Attached sample data

Anonymous
Not applicable
Author

Will this do??

=if(GetFieldSelections(Category)= 'Booked' and [Booked Region] = 'Europe',[Booked Country],if(GetFieldSelections(Category)= 'Managed' and [Booked Region] = 'Europe',[Managed Country]))

Not applicable
Author

Thanks a lot it works.

Anonymous
Not applicable
Author

May be like this

Not applicable
Author

Once I download the file the solution doesn't show somehow. Can you please explain it in text.

MarcoWedel

please try not to open multiple threads for the same question:

Create listbox based on value selected in another listbox

thanks

regards

Marco