1 Reply Latest reply on Sep 26, 2016 6:00 PM by Andrew Watson

    Need help dispalying Table data

    vamshi N

      Hi All,

      I am new to Tableau. I have a table
      with 4 columns like below.

             

      Model_id

      attribute_id

      threshold

      Points

      MI_1

      Attr_1

      0

      31

      MI_1

      Attr_1

      750

      100

      MI_1

      Attr_2

      25

      -100

      MI_1

      Attr_2

      100

      -200

      MI_1

      Attr_2

      200

      -600

      MI_1

      Attr_3

      0

      31

      MI_1

      Attr_3

      24

      67

      MI_1

      Attr_3

      48

      72

      MI_1

      Attr_4

      7

      200

      MI_2

      Attr_1

      0

      28

      MI_2

      Attr_1

      550

      100

      MI_2

      Attr_2

      25

      -100

      MI_2

      Attr_2

      100

      -200

      MI_2

      Attr_2

      200

      -600

      MI_2

      Attr_3

      0

      31

      MI_2

      Attr_3

      24

      67

      MI_2

      Attr_3

      48

      72

      MI_2

      Attr_4

      7

      200

       

      I need a report with drop down
      values of Model_id’s , if we select one from model id should display table like
      below



       
       

      Attribute NameValue ThresholdValue RangeScoreValue Unit
      Attr_100-74931Integer
      750750+100Integer
      attr_22525-99-100Integer
      100100-199-200Integer
      200200+-600Integer
      attr_470-7200Integer


       
      How to do this? Can any one help on this?

       

      Thanks in advance!!
       
       
       
       
       


        • 1. Re: Need help dispalying Table data
          Andrew Watson

          Quite a tricky one. There are a couple of steps to take.

           

          1. Create a calculated field to concatenate your Model and Attribute Ids. We'll use this in the next calculation to tell Tableau to restart a calculation

           

          [Model id] + [Attribute Id]

           

          2. Create a calculated field to find the next threshold value - which is required to start the value range calculation. I called this Calculation1 but you can give a better name.

           

          LOOKUP(SUM([Threshold]),1)

           

          3. Create a calculated field, Value Range.

           

          IF ISNULL([Calculation1]) THEN STR(SUM([Threshold])) + '+'

          ELSE STR(SUM([Threshold])) + '-' + STR([Calculation1]-1)

          END

           

          This is the biggest challenge - make sure the Calculation1 is calculating correctly. It needs to restart for every Model Id/Attribute Id combination. Check the screenshot which is provided by Edit Table Calculation when clicking on the triangle of the field within the worksheet.

           

           

          This checks if the value from Calculation1 is empty - if so you want to put a + sign on the end. If it's not null then we use the value to create the range.

           

          4. Create a simple field for the Integer label. This is a calculated field with the formula 'Integer' (quotation marks required).

           

          This is the finished product. It requires some headers to be hidden to replicate what you expect to see. Hopefully this is clear.