6 Replies Latest reply: Apr 4, 2018 12:05 PM by Brian McNamara RSS

    Logic with IF and Multiple conditions

    Brian McNamara

      Hi,

       

      I am trying to create a dimension that is derived from 3 fields and i am having a difficult time.

      There should end up being three values-

       

      Rep

      Mar

      Partner

       

      This is the SQL I use currently which works as expected -

       

        Select

            case when M =1 then 'Mar'

                  when LeadSource = 'C' or LeadSource='P'

      or M = 0

      or Dbb

      not in (,'Direct','Sales','Brought',') then 'Partner'

                  else 'Rep' end                        

      as  Source

       

      Here is what I have now in my app, but I cant get this worked out ----

       

      If(M  = '1', 'Mar',

       

      If(M  = '0','Partner'

      OR

      If(Match(Dbb,'Partner') = 1 , 'Partner','Rep Created')))


      This only returns 'Mar"

      Any help pointing me in the right direction would be greatly appreciated.


      Thanks

      Brian