2 Replies Latest reply on Nov 1, 2016 6:38 AM by Andrew Watson

    Casting a calculated field as decimal 2

    Brian Green

         I'm using Tableau to display tabular data, I know, I've sinned, but that's what the end user wants. Because I'm using the sheet I'm working on - we'll called it the Header Sheet -   as a filter for the bottom sheet I'm including all people that attended an event regardless of if they completed the survey or not, because if I don't it filters the attendees who failed to take the survey out of the bottom sheet - an attendance roster -  like they never attended.


          The issue is that I average the different types of scores for the respondents and that's one row, but I then have a row of nulls as well, which makes sense as some attendees didn't complete the survey. I then used the below formula to input a blank so I could just format it and not have nulls all over the place. But my final problem is the issue at hand: One of the scores is showing decimals out to 16 places. I want 2, and in SQL I would just cast it as decimal 2 and call it a day, but am not finding that simple solution here. Because I turned it into a string to remove nulls I can't just format it as you normally would with a calculated field. I tried to provide enough context because if there is a fix a few steps back that I'm not seeing I want to consider all options. I feel this will be a simple fix, but I'm not finding it. Please let me know if additional information is needed and thank you for your time Tableau peoples and don't work too hard on a Friday.


      IFNULL(STR(AVG([Applicability])),' ')