9 Replies Latest reply on Oct 24, 2017 9:02 AM by swaroop.gantela

    Trellis/Panel chart for disaggregated data

    Stuart Dunlap



      I've referenced the following post to create a Trellis chart with Tableau.  (I'm using Tableau version 9.3) 




      I find that I'm able to get this to work for aggregated data, however I want to create trellis plots for scatter plots showing detail level data.  My challenge is outlined in the attached workbook.  The worksheet called 'Aggregated Trellis - Works' shows the trellis charts by state for aggregated sales by year.  I would like to do something similar to this, only showing scatter plots of Sales/Profit by state.  The worksheet called 'Detail Trellis - Not Working' has my attempt.  The issue appears to be that the cRow calculation is picking up the index for the detail marks.


      Does anyone know of a way to create trellis charts with scatter plots that show detail marks?



        • 1. Re: Trellis/Panel chart for disaggregated data
          Mia Lee

          Hi, Stuart


          is it that you need an index (calculated measure) for your dimension? not the dimension you have in your dataset?



          • 2. Re: Trellis/Panel chart for disaggregated data
            Stuart Dunlap



            Thank you for your reply.


            I'm looking to create a trellis plot for each state, showing states in mulitple rows/columns to create a matrix of views for the states.  (Have a look at the attachment in my original post - in the ''Aggregated Trellis - Works'' worksheet.)


            Unless I've misunderstood your screenshot, it appears what you've shown is simply putting states in columns with another attribute along row. 



            • 3. Re: Trellis/Panel chart for disaggregated data
              Mia Lee

              Hi, Stuart!



              I guess i am not fully understanding your requirement. Like I asked earlier, do you want a calculated "measure" as your "dimension"?

              Disaggregated means it will show each data point without calculation and you should be "filtering" things out instead of "calculating" the dimension? what is it that you want to place in column/row shelf as your dimension? Do they have to be calculated? if so, by what?



              • 4. Re: Trellis/Panel chart for disaggregated data
                Stuart Dunlap



                What I want is shown in the worksheet called 'Aggregated Trellis - Works' in my original post.  Did you have a chance to review this?  This does have calculated measures being used as discreet values in the Rows and Columns shelves.


                I basically want to recreate the charts showing in the 'Aggregated Trellis - Works' worksheet, only I want to do scatter plots for the charts instead of aggregated sales.


                If you change the parameter setting called 'parm_NColumns' in the  'Aggregated Trellis - Works' worksheet, that may give more insight into the role of the calculated measures.


                Thank you for looking into this.



                • 5. Re: Trellis/Panel chart for disaggregated data
                  Keshia Rose

                  Hi Stuart,


                  Does your data set have a unique row identifier? If so just keep it aggregated but add that to detail.



                  Take care,


                  • 6. Re: Trellis/Panel chart for disaggregated data
                    Stuart Dunlap



                    That's great!!  To answer your question - 'does my dataset have a unique row identifier'? - well... it does now!


                    Thank you for your answer!


                    Just curious, do you think there's a way to create a formula within Tableau that calculates a row number that can be used in this calculation?  I noticed the workbook you sent connected to Sample-Superstore and that the data set now has a Row ID. Anyway, not a biggie on that, I'm just looking for an alternative to adding a Row ID to my source data.



                    • 7. Re: Trellis/Panel chart for disaggregated data
                      Keshia Rose

                      Hmm, I don't think so. If you just used your measure as a dimension, it will only show a mark per each unique value, not per each row in the data set. The only way to make sure that you actually are accounting for every single row would be to uncheck the "Aggregate Measures" option. However, once you do that, there is no way to get the index to work correctly for states(which you need for this to work) since you are telling Tableau to dis-aggregate everything. So even if there is a way (I can't think of one but maybe others know), I feel like it would probably be so convoluted that it wouldn't be worth the effort, especially when it's so easy to just add it to the data.


                      Take care,


                      • 8. Re: Trellis/Panel chart for disaggregated data
                        radhika jain

                        Hi Keshia and others:


                        I have a similar problem. I am trying to create trellis chart of nonaggregated data, in this case, i am using autompg dataset from UC Irvine. When I add indexID which is equivalent to your rowID, i lose my trellis chart. In the attached tableau I have two sheets: one that shows nonaggregated charts of MPG by weight by model year and I would just like to create trellis chart of this. Following Andy's blogpost at Panel charts in Tableau – Gravy Anecdote I created trellis chart in the second worksheet but when I add indexID to detail in this worksheet, it all goes away. Any suggestions?

                        • 9. Re: Trellis/Panel chart for disaggregated data



                          Please see if the attached Sheet 4 could work for you.


                          I think the [RowInd] may have needed two adjustments:


                          if [RowVal] = INT([RowVal])

                          then INT([RowVal])

                          elseif [RowVal] < 1

                          then int ([RowVal])+1

                          ELSE int([RowVal]) +1



                          ( the division of [index of model yr] by [# of columns] may need to be compared against 1,

                          and if it is less than 1, add one to the Int([RowVal)] )


                          For the table calculations of [ColumnInd] and [RowInd3], I needed to change the "Edit Table Calculation" settings to:

                          Compute Using:

                              Specific Dimensions

                                  √ Model yr

                                  √ IndexID


                          At the Level:  Model yr