Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sayadutt
Creator
Creator

Urgent - Creating a listbox by combining unique values from different fields

Hi,

I have 3  fields - which contain some name of persons.

Now i need to create a single ListBox which will join these 3 fields and show me the unique values (there may be same values in 2 fields)

Can you please suggest how i can do this.

Thanks

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You can use the 2-parameter version of SubField(). It will split multiple values in a single cell into different rows, each containing a single value, like:

Tab23:

NOCONCATENATE

LOAD Title, SubField([Associates Working on  ],';') as [Single Associate Working On]

RESIDENT tab ;

You end up with a single field containing all values. Now in the UI, apply whatever count() function you want.

Best,

Peter

View solution in original post

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

You must do this in the script ...

sayadutt
Creator
Creator
Author

Can you please let me know the syntax, i am very new to QV

alexandros17
Partner - Champion III
Partner - Champion III

Send me your document and tell me the fields you want

MayilVahanan

Hi

Give the same name for all three fields.

Ex:

Load fielda as field1 from table1;

Load fieldb as field1 from table2;

Load fieldc as field1 from table3;

Then reload the file. And use that field1 in listbox.

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable

within your load script concatenate all the fields your are looking to see it as a single field.

ex: field1&'-'&field2&'-'&field3

sayadutt
Creator
Creator
Author

Hi,

Currently, I am loading data from SharePoint which has 1 cell containing 3 values.

Eg: 1 project assigned to 3 person (these 3 person names are given in 1 cell, separated by semicolon)

In order to filter on each person name, i am using the below code to split it into 3 fields. (for internal use)

But in the search box i need to search my person name only, thats why i need to generate 1 list.

Can you please let me know where should I add the code you provided.

tab:

LOAD

     [Title  ],

     [Associates Working on  ]

FROM

[sharepoint list path]

(html, unicode, embedded labels, table is @4);

for i=1 to 3

Tab23:

LOAD *, SubField([Associates Working on  ],';',$(i)) as fieldname$(i)

Resident tab ;

next i;

drop table tab;

sayadutt
Creator
Creator
Author

Hi,

Currently, I am loading data from SharePoint which has 1 cell containing 3 values.

Eg: 1 project assigned to 3 person (these 3 person names are given in 1 cell, separated by semicolon)

In order to filter on each person name, i am using the below code to split it into 3 fields. (for internal use)

But in the search box i need to search my person name only, thats why i need to generate 1 list.

tab:

LOAD

     [Title  ],

     [Associates Working on  ]

FROM

[sharepoint list path]

(html, unicode, embedded labels, table is @4);

for i=1 to 3

Tab23:

LOAD *, SubField([Associates Working on  ],';',$(i)) as fieldname$(i)

Resident tab ;

next i;

drop table tab;

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You can use the 2-parameter version of SubField(). It will split multiple values in a single cell into different rows, each containing a single value, like:

Tab23:

NOCONCATENATE

LOAD Title, SubField([Associates Working on  ],';') as [Single Associate Working On]

RESIDENT tab ;

You end up with a single field containing all values. Now in the UI, apply whatever count() function you want.

Best,

Peter