6 Replies Latest reply: Jan 11, 2018 11:05 AM by Sokol Petushi RSS

    Set Analysis with nested IF Statements and Num() Formatting

    Sokol Petushi


      I would like to convert the following if statement to the corresponding set analysis expression hoping in some performance improvements:


      = If(Site = 'North America' AND Sum(RatioFX) > 0 AND Sum(RatioFX) < 1, Num(Sum(RatioFX),'#0.00%'), If(Sum(RatioFX) = 0, 'NA', '100%'))


      I have converted it as follows, but would like to identify a more optimized way to write this as set analysis as I am still using 'IF's so I can format the result:


      = If(Sum({<Site={'North America'}>}RatioFx) > 0 AND Sum({<Site={'North America'}>}RatioFX) < 1, Num(Sum({<Site={''North America''}>}RatioFX),'#0.00%'), If(Sum({<Site={''North America''}>}RatioFX) = 1,'100%','NA'))


      Thank you,