Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

subin6600
Contributor 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_michaelid
Honored Contributor II

Re: How to avoid grey background

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

6 Replies
jason_michaelid
Honored Contributor II

Re: How to avoid grey background

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
Contributor III

How to avoid grey background

Thanks mate! It worked well

jason_michaelid
Honored Contributor II

How to avoid grey background

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
Contributor III

How to avoid grey background

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_michaelid
Honored Contributor II

How to avoid grey background

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
Honored Contributor II

Re: How to avoid grey background

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

Community Browser