4 Replies Latest reply on Jun 6, 2018 3:44 PM by elias.daniels.0

    Variable Creation (aggregated level) for Calculated Field

    elias.daniels.0

      Hi guys,

       

      I will appreciate the help if you could give me a hand.

       

      I have a simple example attached to this email for better understanding.

       

      I'm creating a calculated field based on another calculated fields. The problem is that tableau is following the calculations at record level, but I need it at total level or aggregate level.

       

      Calculation 1:

       

      if [Net]<0 and ABS([Net])>abs([Overhead]) then

       

      [Overhead]+[Net]

       

      elseif

       

      [Net]>0 then [Overhead]

       

      END

       

      The fields Net and Overhead are another calculated fields that I need their aggregate values.

       

      What I'm trying to achieve is:

       

      if (400) < 0 AND ABS((400)) > ABS (200)  

       

      then

       

      200 + (400)

       

      elseif

       

      (400)>0 then 200

       

      END

       

      The result should be (200)

       

       

      Perhaps another work around?

       

      Thanks in advance!

       

      Elias