4 Replies Latest reply on Oct 9, 2017 4:24 AM by Subhankar Mishra

    Separate coloring per row

    Youwei Chen

      I have a dashboard where I need to color each row separately base on measure.  This seem much more difficult than I original thought.

       

      My original data is as follows:

      each financial model have set of statistic at model level:  there are about 30+ of them

      each variable in the model will have a set of variable statistic such as p value, vif.

       

      I joined model and model variable data and use following to represent data:

      businessmodelr2adj r2mapevar_namep_valuevif
      equityus equity0.030.040.07var10.0020.2
      equityus equity0.030.040.07var20.030.4
      ibdibd_model10.060.030.06var10.040.03
      ibdibd_model10.020.010.05var20.020.05

       

       

       

       

       

       

       

       

      I am visualizing data at individual model level, and come up with following visualization:

      My big problem is coloring.  There is a passing/fail value for each of values. For example, if p value is > 0.05, I need to mark it as failed.

      Anyone can give suggestion on how this can be done?

       

      Sample tableu public page:

      Tableau Public

       

      Thanks,

        • 1. Re: Separate coloring per row
          Abhilash Sharma

          Hi Chen,

           

          I have attached the sample workbook with the solution.

           

          Solution:

          Step1:

          Create a calculated field as shown in the screenshot and add it to Colour shelf on Marks card.

          Step 2: Assign colour to Red/Green based on your requirement

           

          Hope this helps.

           

          Thanks,

          Abhilash

          6 of 6 people found this helpful
          • 2. Re: Separate coloring per row
            Youwei Chen

            Thanks for help, your solution will work well for variable_stat table.

             

            Do you know what I can do color model_stat table?  Measure is per row, and there is no column name for value. 

             

            I need something like "Measure Name" = "R2" and val>0.06 then 1 end.  Anything like that available in Tableau?

             

            Thanks.

            1 of 1 people found this helpful
            • 3. Re: Separate coloring per row
              Abhilash Sharma

              Hi Chen,

               

              I have tried a lot of options using different calculated fields. I even added a sample column but unfortunately this cannot be done in Tableau. It will require some next-level hacks which will allow us to make this happen.

               

              By default, Tableau does not have any check where we can check the Measure Name  = R2 and then do threshold the data.

               

              Please mark correct answer/helpful if you agree.

               

              Thanks,

              Abhilash

              1 of 1 people found this helpful
              • 4. Re: Separate coloring per row
                Subhankar Mishra

                Hi Chen,

                 

                This is in response to you and Abhilash.

                 

                Whereas you do not get to use the Measure Names in calculated field but then there is a workaround that can be built to achieve the same:

                 

                Please see below the steps:

                Step 1: Create a text file named Meta Name Data Source, in which you have data as given below:

                 

                Step 2: Add the data source to the existing visualization using Data Blending as given below:

                 

                Step 3: Create a calculated field by the name of MetaMeasure as given below:

                 

                Step 4: After this is created then you need to create a calculated field for Thresholding. I created calculated field named R2 Threshold as given below:

                 

                Step 5: Create the required visualization as given below:

                 

                I have referred this workaround from http://vizdiff.blogspot.in/2016/05/turning-measure-names-into-dimension.html

                 

                Thanks

                 

                Kind Regards

                Subhankar

                12 of 12 people found this helpful