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

set analysis where field1 equals field2

Hi Guys!

I got a data like below:

LOAD * INLINE [

    a

    1

    2

];

LOAD * INLINE [

    b, c

    1, 500

    2, 1000

    1, 200

];

I want to sum 'c' values where 'b' equals 'a' ('a' is not selected and chart shows all possible results).

Any ideas???

Regards,

Bartosz

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Here "IF" works: =Sum(If(b=a,c))

View solution in original post

8 Replies
Not applicable
Author

BUMP

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Your question does not make sense to me. The two tables are not associated, so there is no c where b equals a, because there is no relation at all between a and b.


talk is cheap, supply exceeds demand
PrashantSangle

Hi,

Use Indirect Set Analysis.

P() will help you.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
maxgro
MVP
MVP

maybe

sum({$ <b=P(a)>}c)

Not applicable
Author

Thank You for quick reply Gysbert

I have tried three expressions like below

1. sum({$<b={"=b=a"}>}c)

2. sum({1<b=$::a>}c)

3. sum({$<b=p(a)>}c)

They all show result only when 'a' is selected.

Do you have any ideas what expression shoud I use instead of these or any other workaround?

Thank You very much for Your consideration,

Bartosz

tresesco
MVP
MVP

Here "IF" works: =Sum(If(b=a,c))

Not applicable
Author

Hi Bartosz,

Why don't you left join second table with first table on the basis of the key field ?

That's how you can have "c" field in the same table and then sum it up ,

Regards,

maxgro
MVP
MVP

it works also when a isn't selected

sum({$ <b=P(a)>}c)


1.png