Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Combining values in List box.

I have 2 list boxes Called Country and City.

Country  

USA       

India

State

MA

CA

OH

Delhi

MAH

Kar

Now when I select USA from Country ,can I have MA,CA,OH in state listbox displayed in a single line instead of 3 lines like MA,CA,OH ?

1 Solution

Accepted Solutions
MVP
MVP

Re: Combining values in List box.

Maybe something like

=Aggr( Concat( DISTINCT State,', '), Country)

as list box field <expression> (enter expression from drop down field list), or changing dynamically

=If (GetSelectedCount( Country )  = 1, Aggr( Concat( DISTINCT State,', '), Country), State)

5 Replies
MVP
MVP

Re: Combining values in List box.

Maybe something like

=Aggr( Concat( DISTINCT State,', '), Country)

as list box field <expression> (enter expression from drop down field list), or changing dynamically

=If (GetSelectedCount( Country )  = 1, Aggr( Concat( DISTINCT State,', '), Country), State)

reddys310
Honored Contributor II

Re: Combining values in List box.

Hi Pavana,

If you are looking to display it a horizontal listbox, then its not possible with the filter pane provided. You will have to make use of an extension to achieve this.

Thanks,

Sangram

MVP & Luminary
MVP & Luminary

Re: Combining values in List box.

Hi,

What is the purpose of this?  If you concatenate them into one then you are not able to select individual state, is that OK.

You can try this in script like below

Data:

LOAD

*

FROM DataSource;

StateCombined:

LOAD

Country,

Concat(State, ',') AS StateCombined

RESIDENT Data

Group By Country;

Regards,

jagan.

Siva_Sankar
Honored Contributor

Re: Combining values in List box.

PFA

Like the attached one??

jayaseelan
Contributor III

Re: Combining values in List box.

Hi,

    Please find the below attached .qvf file. hope this is your output. !