Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Greetings all
How can I 'OR' expressions in set analysis?
How can I convert the following to a set analysis expression?
=SUM(If((FieldA = value1 AND FieldB = value2) OR (FieldA = value3 AND FieldC = value4), VALUE_TO_SUM, 0))
Normally anything within the curly braces is "AND" so how do I introduce the "OR"?
=SUM({<FieldA = {value1}, FieldB = {value2} ....... ? >}VALUE_TO_SUM)
Thanks
Josh
Hi,
you can add both expressions within a single set analysis, like this:
=Sum({$<FieldA = {'Value1'}, FieldB={'Value2'}>+<FieldA={'Value3'}, FieldB={'Value4'}>} FieldName)
so you will get:
in other words you will get either 1 OR 2
Regards
Hi Josh,
You can create 2 SUM() expressions with this 2-conditions, then add them.
If you are going to put that in 1 SUM() expression, you will also get the combination for
(FieldA = value1 AND FieldB = value4) and (FieldA = value3 AND FieldB = value2).
so try this...
=SUM({$<FieldA = {value1}, FieldB = {value2}>} fieldname) +
SUM({$<FieldA = {value3}, FieldB = {value4}>} fieldname)
regards,
Allan
Hi,
you can add both expressions within a single set analysis, like this:
=Sum({$<FieldA = {'Value1'}, FieldB={'Value2'}>+<FieldA={'Value3'}, FieldB={'Value4'}>} FieldName)
so you will get:
in other words you will get either 1 OR 2
Regards
Thanks Jaime,
Excelent!
Thanks you so much. That did the trick