1 2 3 Previous Next 36 Replies Latest reply on Feb 27, 2019 1:35 PM by Jonathan Drummey

    Why Do Calculated Fields Destroy My Number Formatting?

    Shawn Wallwork

      Good question!


      [Jason Black just asked this question (well sort of) on another thread.  I think it deserves a thread of it's own, so I've posted it here]


      So Jason I'm going to describe to you the contortions you will need to go through to properly format your measured values if you've chosen to first run them through a calculated field. It's not pretty (and shouldn't be this difficult) but it can be done. As Joe Mako taught me, you can do a series of RAWSQL_ calls, combined with sting manipulations, to format your labels the way you want them to be displayed. Here's a real-world example of what I've had to do to accomplish this:



      Line 2: Rounds the raw data to zero

      Line 3: Calls the data source and displays it as currency

      Line 4: Does the same thing.

      Line 5: Stays in the Tableau workbook and adds a % sign to the calculation

      Line 6: Stays in the Tableau workbook and...


      You get the idea....


      Let me know if you need help with the syntax.




      EDIT: I've attached a text file to make it easier to use these formats.


      Message was edited by: Shawn Wallwork

        1 2 3 Previous Next