2 Replies Latest reply on Jul 19, 2018 4:13 AM by Rouven Hills

    Recreating a Salesforce Formula in Tableau

    Rouven Hills

      Hi there,

       

      I am trying to translate a salesforce formula in Tableau but at the moment I am a little stuck. It is quite a long one so I hope you can follow along.

      It basiclly says, that if the account typ "Consumer" or "Partner" weren't active for a while, then say "Passiv". But if there was recently an activity then say "Active".

       

      IF( AND( OR( TEXT(Account-Type) ="Consumer", TEXT(Account-Type) ="Partner") , NOT( ISBLANK(Opportunity-Classification) ) ) , Opportunity-Classification,

      IF( AND( OR( TEXT(Account-Type) ="Consumer", TEXT(Account-Type) ="Partner") , ISBLANK( Opportunity-Classification ) ,TODAY() - Date_youngest_activity < (30.4*12)) , "Active",

      IF( AND( OR( TEXT(Account-Type) ="Consumer", TEXT(Account-Type) ="Partner") , ISBLANK( Opportunity-Classification ) ,TODAY() - Date_youngest_activity > (30.4*12)) , "Passiv",

      "Passiv") ) )

       

      Could you give me a hand in translating it into Tableau calculated field? Hope this is not too much to ask...

      Thanks for your help in advance.

       

      Greetings

       

      RH

        • 1. Re: Recreating a Salesforce Formula in Tableau
          Deepak Rai

          IF ((ACCOUNT Type="Customer" AND Status<>"Active) OR (ACCOUNT Type="Partner" AND Status<>"Active) ) Then "Passive" Else "Active"  END

           

          Thanks

          Deepak

          • 2. Re: Recreating a Salesforce Formula in Tableau
            Rouven Hills

            Thank for the support I figured it out, it looks like this:

             

            IF [Account-Typ] = 'Consumer' OR [Account-Typ] = 'Partner' AND NOT ISNULL([Opportunity-Classification]) THEN [Opportunity-Classification]

             

            ELSEIF ([Account-Typ] = 'Consumer' OR [Account-Typ] = 'Partner') AND ISNULL([Opportunity-Classification]) AND TODAY()-DATE(Date_youngest_activity]) < 365 THEN "Active"

             

            ELSEIF ([Account-Typ] = 'Consumer' OR [Account-Typ] = 'Partner') AND ISNULL([Opportunity-Classification]) AND TODAY()-DATE([Date_youngest_activity]) > 365 THEN "Passive"

             

            ELSE 'Passive'

             

            END