Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I thought both the below statements are same, so i created the 2nd one using set analysis. But i am getting different outputs
(Sum(IF(Status = 'Cancelled', (Amount)))) + (Sum(IF(Status = 'Booked', (Amount))))
sum( {<Status={'Cancelled'},Status={'Booked'}>}Amount)
Could you please tell me why they are giving different results?
Set analysis would not respond to your Status field selection here, while the other expression without set analysis does. Apart from that:
(Sum(IF(Status = 'Cancelled', (Amount)))) + (Sum(IF(Status = 'Booked', (Amount))))
sum( {<Status={'Cancelled'},Status={'Booked'}>}Amount)
Update: And when it is same field, it take the later one(here 'Booked')
You can try like
Sum( {<Status={'Cancelled','Booked'}>}Amount)
And may be your if statement which is this
(Sum(IF(Status = 'Cancelled', (Amount)))) + (Sum(IF(Status = 'Booked', (Amount))))
gives wrong result try to check and cross check this by using
=Sum(IF(Match(Status,'Cancelled','Booked'), Amount))
Please try like below
sum( {<Status={'Cancelled', 'Booked'}>}Amount)
hi,
try like this
for 2nd expression
sum( {<Status={'Cancelled','Booked'}>}Amount)
it looks like when you use this expression
sum( {<Status={'Cancelled'},Status={'Booked'}>}Amount)
It considers the Status as 'Booked' only
and
when you use like
sum( {<Status={'Cancelled', 'Booked'}>}Amount) then it considers either Cancelled or Booked.
Set analysis would not respond to your Status field selection here, while the other expression without set analysis does. Apart from that:
(Sum(IF(Status = 'Cancelled', (Amount)))) + (Sum(IF(Status = 'Booked', (Amount))))
sum( {<Status={'Cancelled'},Status={'Booked'}>}Amount)
Update: And when it is same field, it take the later one(here 'Booked')
Hi Tresesco,
I just created a sample app where I used the expression like below.
sum( {<Status={'Cancelled'},Status={'Booked'}>}Amount)
I didn't have data points that has both Cancelled and Booked Status that means it (the AND operator) should have given me 0 as there were no items in common, however I found that the result is the value of Status = "Booked". Can you please check once and confirm? I tested this using a sample app of mine.
Hi Tresesco,
As you mentioned, Could you please explain me why Set analysis would not respond to your Status field selection in the below expression-
sum( {<Status={'Cancelled'},Status={'Booked'}>}Amount)
both are same .may be not distinct and distinct results
but you can write like Sandeep and Nisha.
hope this helps
I just checked your update. Thanks a lot.
In case of same field it takes the later one. Thanks again.