Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a way to create 2 variable drop-down box? Such that the output of the second variables drop-down depends on the first variable input.
Hello,
If my understanding is correct. You want to created 2 Variable inputs charts (drop-down) where the options of the second one are depended on the selection of the first one. There is a way to achieve that as follows:
=Pick(
'$(varSelectedCountry)',
'Madrid~Madrid | Valencia~Valencia | Barcelona~Barcelona',
'Larnaca~Larnaca | Nicosia~Nicosia | Limassol~Limassol',
'Athens~Athens | Thessalonki~Thessalonki | Patra~Patra'
)
This expression is using the function Pick() [1], which selects and returns one of the expressions based on the value that is stored in the variable varSelectedCountry. The result is:
As you can see the options for the second Variable input object are changing based on the selection of the first Variable input object. I hope that this information was helpful.
---
Can you share one sample example and output image( may be manually drawn) to understand exactly what you are looking for?
Something like this. If I select a specified state, respective cities should be displayed.
Normally the required behavior is automatically achieved if the state and city are properly associated in the data model. I would still want to confirm if the State and City are the fields in your data model? You mentioned them as 'variable' in the initial question so got confused. 'Variables' have different usage in Qlik so need more details.
Hello,
If my understanding is correct. You want to created 2 Variable inputs charts (drop-down) where the options of the second one are depended on the selection of the first one. There is a way to achieve that as follows:
=Pick(
'$(varSelectedCountry)',
'Madrid~Madrid | Valencia~Valencia | Barcelona~Barcelona',
'Larnaca~Larnaca | Nicosia~Nicosia | Limassol~Limassol',
'Athens~Athens | Thessalonki~Thessalonki | Patra~Patra'
)
This expression is using the function Pick() [1], which selects and returns one of the expressions based on the value that is stored in the variable varSelectedCountry. The result is:
As you can see the options for the second Variable input object are changing based on the selection of the first Variable input object. I hope that this information was helpful.
---
Thanks !!! It Worked