5 Replies Latest reply on Sep 15, 2013 10:37 PM by Ville Tyrväinen

    if statement with string and integer

    Matthew McLaughlin

      Morning, all!

       

      Trying to add a calculated field that displays the value for field SRLHU if OPDSMX = 10.  In Excel, I can do this: 

       

      =IF(D6=10,E6,0)

      where D6 = OPDSMX and E6 = SRLHU

       

      I'm using tableau 8.0.3 and tried:

      if ATTR([MOROUTL0 (AMFLIB)].[OPDSMX]) = 10 then [SRLHU] end

       

      but I get two errors:

      1. Can't mix string and integer values
      2. Cannot mix aggregate and non-aggregate comparisons or results in 'if' expressions

       

      I've checked the fields and none show as aggregates.  I'm very new to this and am certain I am leaving out something small.

       

      Any assistance is greatly appreciated!

       

      Thanks in advance!

       

      Matt