13 Replies Latest reply on Jun 12, 2018 7:06 AM by Ruben Arias

    % Parameter calculation

    Ruben Arias

      Hello Tableau'ers.  I am trying to create the following % parameters under gross profit % column for my report:

       

      >10%

      <10%-0%

      <0%

      ALL %

       

      How do I write the calculated field correctly, in order to produce the parameters outlined?  Below is what I have for my $ parameter, which is working correctly.  I attempted to amend it with the new fields but no luck.

       

      IF [selection %] = 'All Positive Values' THEN

          (IF [Calc : % DIff] > 0 THEN [Calc : % DIff] END)

      ELSEIF [selection %] = 'All Negative Values' THEN

          (IF [Calc : % DIff] < 0 THEN [Calc : % DIff] END)

      ELSE

          ([Calc : % DIff])

      END

       

      Thanks!!