Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare two columns

Hi guys,

I am struggling with below simple case. I have got data like this:

LOAD * INLINE [

    ID, AMT

    1, 100

    2, 200

    3, 400

];

LOAD * INLINE [

    TST

    1

    3

    5

];

And when I select two values or more on TST then I would like to see this values be selected on ID and show me sum of AMT for it.

Please check below images and my incorrect expression.

Correct:

1.PNG.png

2.PNG.png

My Problem:

3.PNG.png

Thank You in advance!

Sebastian

1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe

sum({$ <ID=P(TST)>} AMT)

View solution in original post

3 Replies
giakoum
Partner - Master II
Partner - Master II

if you write ID={'1,3'} it will work.

To have that live and not hard coded, use the concat function to create the 1,3 or whatever is selected, and use it either directly or through a variable in your set analysis

Somehting like : ID={"$(=concat(TST, ','))"}

Anonymous
Not applicable
Author

you have to use the concat function

sum({<ID={=concat(TST,",")}>}AMT)

maxgro
MVP
MVP

maybe

sum({$ <ID=P(TST)>} AMT)