5 Replies Latest reply on Feb 15, 2019 8:54 PM by Andres Garcia

    Different unit measures in one table

    Cecilia Saldaña

      Hello,

       

      I have a table with different units measure for different rows (see Example).

      Can I work in Tableau pulling the unit measures to my tables?

       

      KPI
      Amount
      Sales$120,000
      Profit %15%
      Units Sold

      # 38

       

      Can I add this information to Tableau pulling the measures symbols... considering everything is in the same table (data source).

      There are around 40 measures in the table, coming from different sources,,, that is why I prepared one table concentrating everything,,, but there are different measures with different unit measures in it...

       

      Any suggestions?

      Thank you

        • 1. Re: Different unit measures in one table
          Andres Garcia

          Sorry, I didn't understand your question, do you want to take out the measurements units?

           

          KPI

          Amount

          Sales120,000
          Profit %15
          Units Sold

          38

           

          or do you want to extract the measuring units into another field

           

          KPI

          Amount

          UoM

          Sales120,000$
          Profit %15%
          Units Sold

          38

          #

           

          Andres FG

          • 2. Re: Different unit measures in one table
            Cecilia Saldaña

            This is an example,

             

            KPI                       This year         Last Year         This year vs Last year 

            Sales $                $135,000        $120,000                       5%                

            Amount #                38 #                35 #                           7%

            Profit %                  22%               20%                          10%

             

            Each row has a different unit measure,,, and I want to be able to present those units in Tableau... so when a line refers to a percentage,,, it becomes easy to read the table...

             

            Information from that table will be pre-processed,, there are many rows in the same report... and several columns as well.. so I decided to pre-work the table, and just present processed information in Tableau... but I cant get to display % and # depending on the KPI name...

            • 3. Re: Different unit measures in one table
              Cecilia Saldaña

              I am trying something like this, but It doesnt work..

               

              IF [Indicador]="Dias"

              THEN [amount with #] ELSE [amount]

              END

              • 4. Re: Different unit measures in one table
                Cecilia Saldaña

                The idea is to put an amount including the % or #... or putting just the amount (without symbol) depending on columns content.

                 

                IF [Indicador]="Dias"

                THEN [25 #] ELSE [25]

                END

                • 5. Re: Different unit measures in one table
                  Andres Garcia

                  Hi Cecilia, sorry for the late response, was a crazy week hehe.

                   

                  so you want to concatenate the symbols. like $ + 135,000 --> $135.000. To do this you need to convert your measures to string so you can add the symbol.

                   

                  IF [Indicador]="Dias"

                       THEN STR([this year]) + "#"

                  ELSEIF [Indicador]="Sales"

                       THEN "$" + STR([this year])

                  ELSEIF //All your other KPIs

                  END.

                   

                  you will have to be very carefull with percentages as the percentages sometimes came as 0.25, you will need to multiply for 100 then concatenate the % symbol, like:

                   

                  IF [indicator] = 'percentage_field'

                  THEN STR([value]*100) + "%"

                   

                  Best Regards

                   

                  Andres FG