2 Replies Latest reply on Sep 29, 2018 10:17 PM by Dan Barrington

    Excel Percent to Tableau String

    Dan Barrington

      I'm facing an issue where I've done my calculations and formatting in Excel (so the field/percentage shows exactly how I want it to in Excel), but I cannot migrate that format into Tableau.

       

      I've seen threads discussing the math, but this is a question about format. So far, I've tried the following two scenarios:

       

      Scenario 1: I have a cell in Excel with the value 2.1%. Now, I would like to display it as just that in Tableau however, if the value is null (in Excel), then I want to display "Value Not Found" in Tableau. Here is what I thought would work:

      Create a calculated field in Tableau with the following formula:

      IF ISNULL([cell]) then 'Value Not Found'

      ELSE STR([cell])

      END

      This does not work. it displays the full value of the percentage, prompting me to change the formula to:

      IF ISNULL([cell]) then 'Value Not Found'

      ELSE STR(ROUND([cell],1)) + '%'

      END

      Or:

      IF ISNULL([cell]) then 'Value Not Found'

      ELSE STR(ROUND([cell] *100,1)) + '%'

      END

      The ROUND function is not working as I would expect in this case (unless the second parameter of the ROUND function is changed to 0, many decimal places are displayed after the decimal, no matter what I make the second parameter).

       

      The second scenario is pretty much the same, the only difference is I tried making the number just a general number in Excel, and then doing the conversion in Tableau. I did see one thread about this issue when dealing with a SUM, but I wasn't able to clearly translate that to my situation. Any help on the matter is appreciated. Thank you very much in advance.