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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to match multiple selected codes in a Subfield

Hello Everyone,

I have these tables:

Catalog:

load * inline [

Code, Description

1000, New York

6000, Las Vegas

6005, San Jose

6007, San Francisco

0, No Name];

Airlines:

load * inline [

Airline, CodeList

1, '1000,6005,0'

2, '6007,6005'

3, 6000

4, '0,1000,6007,6000,6005'];

Catalog in ListBox1 and Airlines in ListBox2

I need to show in ListBox2 all the records selected in ListBox1 comparing them with CodeList field.

Example if in ListBox1 the user selected : 6000,6007. I need to Select in ListBox2 these records:

Airline, CodeList

2, '6007,6005'

3, 6000

4, '0,1000,6007,6000,6005'

Any ideas?

I attached the sample file.

Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar

Or may be this:

='(' & Concat({<CodeList = {$(=Chr(39) & Concat('*' & Code & '*', Chr(39) & ',' & Chr(39)) & Chr(39))}>}Airline, '|') & ')'

View solution in original post

4 Replies
Anonymous
Not applicable
Author

The CodeList values in the Airlines looks a bit weirdly formatted. almost as something went strange in a load from delimited text file.

Could you share source file that were loaded from ?

swuehl
MVP
MVP

Try something like

=Aggr(

If(Wildmatch(CodeList,$(=chr(39)&'*'&Concat(Code,'*'&chr(39)&','&chr(39)&'*')&'*'&chr(39))),Airline&'-'&CodeList)

, Airline)

sunny_talwar

Or may be this:

='(' & Concat({<CodeList = {$(=Chr(39) & Concat('*' & Code & '*', Chr(39) & ',' & Chr(39)) & Chr(39))}>}Airline, '|') & ')'

MarcoWedel

Hi,

one solution could be also:

QlikCommunity_Thread_203325_Pic1.JPG

QlikCommunity_Thread_203325_Pic2.JPG

or maybe

QlikCommunity_Thread_203325_Pic3.JPG

QlikCommunity_Thread_203325_Pic4.JPG

Catalog:

LOAD * Inline [

Code, Description

1000, New York

6000, Las Vegas

6005, San Jose

6007, San Francisco

0, No Name

];

Airlines:

LOAD Airline,

    Text(CodeList) as CodeList

Inline [

Airline, CodeList

1, '1000,6005,0'

2, '6007,6005'

3, 6000

4, '0,1000,6007,6000,6005'

];

tabLink:

LOAD Distinct

    CodeList,

    Trim(SubField(CodeList,',')) as Code

Resident Airlines;

hope this helps

regards

Marco