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: 
rafael5958
Creator
Creator

contains in expression

I need an expression that retuns true if the selected value is in a column. Example:

TABLE_A:
LOAD * INLINE [

    ID1

    AAA
    BBB
    CCC
    DDD

];

TABLE_B:
LOAD * INLINE [

    ID2

    AAA
    HHH
    KKK
    RRR
];

 

In Table_B if I click in AAA it should return true in a textbox. Tried to use FieldIndex, match, wildmatch, but it doesnt work, only when I select AAA in both tables, but Table_A cant be selected, it must search in all table.

Thanks.

Labels (1)
1 Solution

Accepted Solutions
Taoufiq_Zarra

I don't know if I understood correctly, but here's a proposition...

Text Object Script :

=if(match(GetFieldSelections(ID2),$(=concat(chr(39)&ID1&chr(39),',')))>0,'True','False')

 

output :

Capture.PNG

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra

I don't know if I understood correctly, but here's a proposition...

Text Object Script :

=if(match(GetFieldSelections(ID2),$(=concat(chr(39)&ID1&chr(39),',')))>0,'True','False')

 

output :

Capture.PNG

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Vegar
MVP
MVP

Maybe you can try something like this:

=if(Count({<ID1=P(ID2) >} ID1) > 0, 'True', 'False')