Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table with many columns on my dashboard, the table format and content is similar to this one (trying to show with dummy data):
Country_Category1 | City | Street | Country_Category2 | City | Street |
---|---|---|---|---|---|
Spain | Madrid | street1 | Sweden | Stockholm | street4 |
Germany | Bremen | street2 | Denmark | Copenhagen | stree5 |
Belgium | Brussels | street3 | Norway | Oslo | street6 |
Sweden | Stockholm | street4 | Spain | Madrid | street1 |
I want to add a filter for countries but rather than adding filters per each Country_Category, I would like to have a flag called e.g. 'Country_Flag' in a list box with values: Country2 and Country2, etc.. and then to have another list box for countries which can dynamically be changed according to the flag in 'Country_Flag' list box.
Wanted to test with two countries, created a list box (called 'Country_Flag') with two values: Country1 and Country2. Then I created another list box (called 'Country' with field as an expression, here is the script for the expression:
If((GetFieldSelections(Country_Flag)='Country1') ,Country_Category1,
If((GetFieldSelections(Country_Flag)='Country2') ,Country_Category2))
Now switching between flag values changes the displayed lists in 'Country' list box. If I allow multiple selections in 'Country_Flag' list box and I select a country from 'Country' list box, both flags (Country1 and Country2) get activated. If click 'Always One Selected Value' from the 'Country_Flag' list box properties, the 'Country' list box does not work.
Note: in my table similar countries can occur both under Country_Category1 and Country_Category2
Any idea?
Added sample files with both scenarios: when multiple or a single value is selected in the list box.
Quick suggestion but why not just make life easier and have two list boxes which you hide and show?
Hi,
Please attach sample qv application for better resolution.
Added sample files.
Quick suggestion but why not just make life easier and have two list boxes which you hide and show?
The thing I have more than 2 columns wich needs to have list boxes (6 columns), so my idea was to change the content in one list box only based on the content of the "flag" filter, i.e. based on another list box where I include the values pointing to the columns.
What exactly isn't working in your Always-One-Selected-Country_Flag document? What do you expect to be displayed in the Country listbox?
Hmm yes that would be easier than 6 list boxes for sure, Qlik doesn't seem to like it though!
I will have a further play when I get a second.
Peter,
The list box displays the correct values but doesn't allow a selection in the relevant column
*edit* It does allow a selection but not when the country is in both columns, that makes sense really as Qlik doesn't know what to do with it
If you select one value from Country_Flag, you will not be able to select any value from Country list box.
Ah, I see. Selecting one category in Country_Flag blocks selection in your dynamic listbox...
How about creating two fixed listboxes, both called Country but one of them showing field Country1 and the other showing Country2. In each listbox, enter a Layout->Conditional show expression that is true only when the corresponding selection is made in Country_Flag. Align the two listboxes on top of each other...