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

Help with SET ANALYSIS

Hi guys,

I'm in trouble with an expression.

I have to do the sum of Field3 ONLY if Field1 = Field2.

I tried to solve my problem using this expression:

=sum( {$<Field1 = Field2>} Field3 )

but unfortunately it doesn't work.

It works fine only if I select a value from a list box, but I need it works with any selection.

Any help will be appreciated.

Thanks in advance

6 Replies
Not applicable
Author

Set analysis is based on selected vlaues. If you want it to work without the selection try sum(if())   something like:   sum(if(Field1= Field2, Field3,0)   Regards  Rahul Lakhina

Not applicable
Author

Hi Rahul,

First of all, thank you so much for your reply.

I alredy tried that kind of formula and it doesn't work.

I thought it could work.

Regards

Giampiero

Not applicable
Author

What data do you have in Field 1 and 2 can you post an example? Plus you might have to aggr this over your dimension.   Try:   aggr(sum(if(Field1= Field2, Field3,0) ,dimension)   Regards  RL

Not applicable
Author

Not applicable
Author

Field 1 and 2 are plates of trucks.

Unfortunately it's quite difficult to me to post an example.

I tried aggr function but it doesn't work.

Thanks Rahul.

Regards

Giampiero

Not applicable
Author

Rahul,

I can say you that Field 1 is in TAB1, Field2 & Field3 are in TAB2.

Hope it helps to better understand.

@Chris: Thanks a lot

regards

Giampiero