3 Replies Latest reply: Jun 21, 2012 5:47 AM by Nick Gan RSS

    Multiple conditions in SET ANALYSIS

      I have a following IF statement

      if( days_affected >30  and Date2 < '12/31/2009', (Sum(Sales)*100), if(days_affected >30  and Date2 > '12/31/2009', (Sum(Sales)*2), Sum(Sales)  )).

      Now i want to implement this using SET ANALYSIS. Is it possible? If so please reply me ASAP.

        • Re: Multiple conditions in SET ANALYSIS



          You could try something like below.


          (Sum({<days_affected = {">30"},Date2 = {"<$(=Date(Date#('12/31/2009','MM/DD/YYYY'),'MM/DD/YYYY'))"}>} Sales)*100)


          (Sum({<days_affected = {">30"},Date2 = {">$(=Date(Date#('12/31/2009','MM/DD/YYYY'),'MM/DD/YYYY'))"}>} Sales)*2)


          if((days_affected >30  and Date2 < '12/31/2009') or (days_affected >30  and Date2 > '12/31/2009'),0,Sum(Sales))


          Above expression is an untested code. Make sure your data formats are correct with Date2 field.


          Hope this helps you.


          - Sridhar