Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Users, make your voice heard! Participate in Wisdom of Crowds® Market Study: Start Survey
cancel
Showing results for 
Search instead for 
Did you mean: 
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
swuehl
MVP
MVP

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)

View solution in original post

5 Replies
swuehl
MVP
MVP

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)

View solution in original post

reddy-s
Master II
Master II

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

jagan
MVP & Luminary
MVP & Luminary

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
Master II
Master II

PFA

Like the attached one??

jayaseelan
Creator III
Creator III

Hi,

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