0 Replies Latest reply on Nov 12, 2018 8:32 AM by Graeme Elliott

    Advanced Conditional Formatting/Calculated Field

    Graeme Elliott

      Hi all,

       

      I have attached a worksheet where I am having some trouble doing some conditional formatting.

       

      There is a table here which is providing a breakdown of how client's customers vote on their websites. The clients can have one of two voting systems - either thumbs up/thumbs down or five stars. Statistically speaking - the big difference here is that thumbs up/down logs a vote of 0 (bad) / 1 (good) whereas the five stars has 1 and 2 as bad and 3-5 as good. So this means that 1 changes from good to bad depending on the voting type.

       

      There are two columns in this table - % of Total Votes Increase/Decrease Mom (%) and Votes Difference MoM (%) - the calculations for these are already done and working (basically comparing MoM data for the percentage of totals and difference) - now what I want to do is color them in based on whether the difference is positive or negative. What this will look like is as follows:

       

      Up/Down:

       

      If the MoM difference has increased for 0 votes - Red

      If the MoM difference has decreased for 0 votes - Green

      If the MoM difference has increased for 1 votes - Green

      If the MoM difference has decreased for 1 votes - Red

      Else, if same/no change, then Yellow

       

      1 - 5

       

      If the MoM difference has increased for 1-2 votes - Red

      If the MoM difference has decreased for 1-2 votes - Green

      If the MoM difference has increased 3-5  votes - Green

      If the MoM difference has decreased 3-5 1 votes - Red

      Else, if same/no change, then Yellow

       

      I do have one column colored in but it is wrong. That is there to show how the formatting could look.

       

      My initial question is - how hard is it to do this type of formatting in Tableau?I have tried briefly to build a calculation that would look at the voting type first, and if the voting type equaled "Up/Down" then do this, else do this, but couldn't quite get it to work. How can I tackle this problem? What would be the best and easiest method?

       

      Thanks once again for the help!