4 Replies Latest reply on Oct 3, 2016 7:49 AM by Fabio Garcia

    Number of decimal places

    Fabio Garcia

      Good morning, people!

       

      I should format a metric to one decimal place (%Conversão), but this metric is within a case. I can not use the formatting of the tableau for the whole field, because the other metrics need to stay without decimal place.

       

       

      Could you help me, please?

       

       

        • 1. Re: Number of decimal places
          Andrew Watson

          What about doing the formatting within the calculated field?

           

          For example:

           

          CASE [escolha a mertica]

          WHEN 'Acessos' THEN ROUND([Usar Sessaoes],0)

          ...

          WHEN '%Conversao' THEN ROUND([%Conversao],1)

          END

          1 of 1 people found this helpful
          • 2. Re: Number of decimal places
            Luciano Vasconcelos

            Bom dia.

            Tenho uma alternativa para você:

            Duplique o gráfico e use um para o percentual de conversão e outro para as outras métricas.

            De acordo com o parâmetro você escolhe qual gráfico mostrar.

            • 3. Re: Number of decimal places
              Michael Hesser

              Hello Fabio;

               

              This is going to be a messy solution, but it may work:

               

              Within your case function, ROUND all your variables to the number of decimal places you desire (0 decimal places for most, with the exception of your %).

               

              Now convert the output from a number, to string. So your case might look like:

               

              case [XYZ]

              when "selection 1" then str(round([Measure 1],0))

              when "selection 2" then str(round([Measure 2],0))

              when "selection 3" then str(round([Measure 3],))

              when "selection 4" then str(round([Measure 1],2)+"%"

               

              You can right justify your column to make it look pretty. I hope this gives you food for thought!  --Michael

               

              Note: You won't need the ROUND function on your other variables if they are already integers.

              1 of 1 people found this helpful
              • 4. Re: Number of decimal places
                Fabio Garcia

                Michael, your solution was the easiest one.

                 

                Tks!