Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rudywelvaert
Creator
Creator

Listbox using splitted string values

Hi,

In a table there is a string column that contains several values separated by a comma and surrounded by brackets or the indication N/A (not available)

Table_Meta.png

I need following:

  • A list box that shows the separate values that occur in the META column inclusive the N/A indication and based on the column META of the table.

ListBox_Meta.png

  • When I select one ore more values in the list box, in a straight table that shows the records from the table, only the records that contain in the field META at least one or all the selected values in the list box.

The option "at least one" or the option"all" of the selected values should be indicated via a switch (using e.g. buttons and a switch variable):

In case of choosing the option "all" I should get this result:

Select_All.png

In case  of choosing the option "at least one" I should get this result:

Select_One.png

Included the qvw file Split_String_List.qvw where the table is loaded and a listbox, two buttons, a straight table and a variable is put on the sheet Main.

Thanks

R.W..

1 Solution

Accepted Solutions
sunny_talwar

Not sure, but why don't you try to create METAVALUE using SubField function

Data:

LOAD ID, META INLINE [

ID, META

1,  '(main,person,address,career,income)'

2,  '(main, profession,address,income,contribution)'

3,  '(address,career,contribution)'

4,  N/A

5,  '(person,profession,career)'

6,  '(address,profession,income,contribution)'

7,  '(address,main,person,income)'

8,  '(income,person,address,profession,career,contribution)'

9,  '(main,person,address,profession,career,income,contribution)'

10, '(main,career)'

11, '(person,main,address)'

12, '(person,profession,career,income)'

13, '(main,profession)'

14, '(career,address,profession, income,contribution)'

15, '(main,person,address,profession,career,income,contribution)'

16, '(profession,person,address,contribution)'

17, '(career,address,income,contribution)'

18, '(main,career)'

19, '(main,address,profession,career,income,contribution)'

20, '(address,person,income)'

21, N/A

22, '(person,main,profession)'

23, '(career,main,person,profession,income,contribution)'

24, '(main,contribution)'

25, '(main,income)'

];


Meta:

LOAD META,

SubField(PurgeChar(META, '()'), ',') as METAVALUE

Resident Data;

Now when I select address in METAVALUE, I see this

Capture.PNG

View solution in original post

5 Replies
sunny_talwar

Not sure, but why don't you try to create METAVALUE using SubField function

Data:

LOAD ID, META INLINE [

ID, META

1,  '(main,person,address,career,income)'

2,  '(main, profession,address,income,contribution)'

3,  '(address,career,contribution)'

4,  N/A

5,  '(person,profession,career)'

6,  '(address,profession,income,contribution)'

7,  '(address,main,person,income)'

8,  '(income,person,address,profession,career,contribution)'

9,  '(main,person,address,profession,career,income,contribution)'

10, '(main,career)'

11, '(person,main,address)'

12, '(person,profession,career,income)'

13, '(main,profession)'

14, '(career,address,profession, income,contribution)'

15, '(main,person,address,profession,career,income,contribution)'

16, '(profession,person,address,contribution)'

17, '(career,address,income,contribution)'

18, '(main,career)'

19, '(main,address,profession,career,income,contribution)'

20, '(address,person,income)'

21, N/A

22, '(person,main,profession)'

23, '(career,main,person,profession,income,contribution)'

24, '(main,contribution)'

25, '(main,income)'

];


Meta:

LOAD META,

SubField(PurgeChar(META, '()'), ',') as METAVALUE

Resident Data;

Now when I select address in METAVALUE, I see this

Capture.PNG

Anil_Babu_Samineni

I am not flly understand your case. But subField() helps

SubField(PurgeChar(FieldName, '()'), ',')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pradosh_thakur
Master II
Master II

use subfield() to split the values.

Learning never stops.
sunny_talwar

And may be use And-Mode for showing the result where both value exists

Capture.PNG