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?
Suraj,
Set analysis is meant for that. In the expression: sum( {<Status={'Cancelled'},Status={'Booked'}>}Amount)
you specifically say the values to be considered for field Status. Hence, it ignores the selection for that field.
first one is showing correct result
and second one is overriding the status to Booked.
changed the order of booked and cancelled in second expression.
it will give other result.
i mean to say it taking last one status and showing value on that.
hope this helps
Given below is a screenshot of what I tested in my sample Application.
As you can see when I have the expression {<Field={'value1', 'value2'} >} it considers as either or that means all from both the selection.
when I gave the expression like {<Field={'value1'},Field={'value2'} >} it considers it as two selections of same field but one after another. and finally it considers the second selection. this is same response when we select a value from a list box and then we select another value from the same list box. the first selection is overridden by the second selection.
Thanks a lot to everyone for explaining it so well, especially tresesco and sudeep
you can use the following expressions :
Sum(IF(Status = 'Cancelled' or Status = 'Booked', Amount)
or
sum( {<Status={'Cancelled' , 'Booked'}>}Amount)
Hi,
I agree with Sudeep,
sum( {<Status={'Cancelled','Booked'}>}Amount), this will returns both selections
If you add 1
sum( {1<Status={'Cancelled', 'Booked'}>}Amount), it will disregard any selection made
Regards,