Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
User12321
Contributor III
Contributor III

Count if row value difference is positive

Hi,

I have Table1 with fields Quantity1, Quantity2 and QuantityKey, Table 2 with field Conversion1 and Table3 with field Conversion2.

I want to count the number of different QuantityKey with the following condition:

Quantity1 x Conversion1 - Quantity2 x Conversion2 is positive 

Can someone help please. Thank you.

Labels (1)
1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

Hi 
try this one :

Sum(AGGR(if(Quantity1*Conversion1-Quantity2*Conversion2>0,1,0),QuantityKey))

View solution in original post

1 Reply
lironbaram
Partner - Master III
Partner - Master III

Hi 
try this one :

Sum(AGGR(if(Quantity1*Conversion1-Quantity2*Conversion2>0,1,0),QuantityKey))