3 Replies Latest reply on Dec 20, 2013 11:57 AM by Matt Lutton

    Calculated fields for labeling

    Doug Stanley

      I have two data fields that rate confidence levels from 1 to 5. I'm displaying each on a single bar chart.

       

      Capture.PNG.png

       

      I would like to add a label or a tooltip element that adds a description for the numerical values. This works if I'm displaying only the confidence indicator bar:

       

      if [confidence scale] = 1 then "Unknown"

      elseif [confidence scale] = 2 then " 'Guesstimate' "

      elseif [confidence scale]=3 then "Informed estimate"

      elseif [confidence scale]=4 then "Informal disclosure"

      elseif [confidence scale]=5 then "Formal disclosure"

      end

       

      Similarly, the following works if I'm displaying only the future trend bar:

       

      if [future trend)] = 1 then "Strong downward"

      elseif [future trend] = 2 then "Weak downward"

      elseif [future trend] =3 then "Flat"

      elseif [future trend)] =4 then "Weak upward"

      elseif [future trend)] =5 then "Strong upward"

      end

       

      Tableau accepts this syntax when I try to combine them, but the result is not what I want:

       

      if [Total confidence level 1-5 scale] = 1 then "Unknown"

      elseif [Total confidence level 1-5 scale]= 2 then " 'Guesstimate' "

      elseif [Total confidence level 1-5 scale]=3 then "Informed estimate"

      elseif [Total confidence level 1-5 scale]=4 then "Informal client disclosure"

      elseif [Total confidence level 1-5 scale]=5 then "Formal client disclosure"

      elseif [Total wallet future trend (1 to 5)] = 1 then "Strong downward"

      elseif [Total wallet future trend (1 to 5)] = 2 then "Weak downward"

      elseif [Total wallet future trend (1 to 5)] =3 then "Flat"

      elseif [Total wallet future trend (1 to 5)] =4 then "Weak upward"

      elseif [Total wallet future trend (1 to 5)] =5 then "Strong upward"

      end

       

      How do I get Tableau to add the appropriate label (or tooltip element) to the appropriate bar?

       

      Many thanks.