Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
subin6600
Creator III
Creator III

How to avoid grey background

Hi Qlikviewrs!

For example, I have countries & for each I have states defined.

So two field : Country & States

In the first list box I select a country.. In another list box I want only the states of that particular country to be visible.

But i also have some grey area when i try to hide the states of unselected country,

How do i avoid it?

Note*: Both the size(LxB) should be the same.

Please find the attached example to try it out. Thanks

BR/ Subin

1 Solution

Accepted Solutions
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Hi Subin,

Create a variable, vStates and set to:

='ValueList(' & Chr(39) & Concat(DISTINCT States, Chr(39) & ',' & Chr(39)) & Chr(39) & ')'

Then, in the listbox just use =$(vStates)

See attached,

Hope this helps,

Jason

View solution in original post

6 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Hi Subin,

Create a variable, vStates and set to:

='ValueList(' & Chr(39) & Concat(DISTINCT States, Chr(39) & ',' & Chr(39)) & Chr(39) & ')'

Then, in the listbox just use =$(vStates)

See attached,

Hope this helps,

Jason

subin6600
Creator III
Creator III
Author

Thanks mate! It worked well

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Hmmm - just realised that this solution will not allow you to select a state!  There is a simpler way - in the listbox just use:

=Aggr(States,States)

Jason

subin6600
Creator III
Creator III
Author

Hi Jason,

I totally overlooked it. thansk for the reply again. But I have got another problem now.

As soon as I select a state the other options gets hidden. Can it be in any way even make them always shown?

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Why don't you like the standard QV functionality here?  Select a Country and all associated States are in white, unassociated in grey.  Select a State and it goes green, all others go grey.  It's clean and clear!

IAMDV
Luminary Alumni
Luminary Alumni

Hi,

I strongly agree with Jason. Probably you should try to educate the EU about QV associated logic. Anyway if you still wanted a solution then please try this expression :

=Aggr(MAXSTRING({1*$<[States]={'*'}>} [States]), States)

And I'm attaching the sample application.

Cheers,

DV