2 Replies Latest reply on Mar 20, 2015 2:18 PM by Matt Morgan

    Using a table calculation as a dimension

    Tim Welsh

      I have casino data that tracks players (by an ID) and the min bet limits of the tables they bet on. Each row is a 'player session' which begins when the player sits down at a table and ends when the player leaves that table. If the player leaves and then returns or visits another table, then a new row of data is recorded. 


      I have created a table calculation, TableMinGrp, to display the most frequently visited table minimum limit for each ID. I want to classify players by this value. For instance ID #1000 may have bet most at $100 tables and so is classified as such and grouped with other $100 players. I then wanted to plot, either in bar or pie form, the percentage of bets made at other tables minimums. So maybe $100 players bet at $100 tables 60% of the time, $50 tables 30% of the time, and $200 tables 10% of the time. I have created such a visualization with my table calc but now have run into an issue with the tooltip. Unfortunately the level of detail is by ID so hovering over gives a specific player's percentage (instead of the cumulative percentage for the table min limit). This should be able to be solved with a simple window_sum, however I cannot seem to partition by my calculated field TableMinGrp. Despite it acting like a dimension in my view it cannot be dragged there or used as one. I am hoping there is a workaround for this, or if not, that there is some way to accomplish what I want without table calcs.


      I have attached a sample workbook of data with my viz.

        • 1. Re: Using a table calculation as a dimension
          Jonathan Drummey

          Hi Tim,


          You wrote, "Despite it acting like a dimension in my view." I think what you're imagining is that because the TableMinGrp is making visual partitions in the view that it's a dimension, when in fact it's a discrete measure and it's the "discrete" part that is visually partitioning the view. There are two distinctions we need to make, dimension vs. measure and discrete (blue pill) vs. continuous (green pill). See http://www.theinformationlab.co.uk/2011/09/23/blue-things-and-green-things/ for more information.


          Tableau can partition table calculations by dimensions, and partition table calculations by discrete regular aggregate measures (by turning off the "Ignore in Table Calculations" flag for a discrete measure), but it currently cannot partition table calcs by other table calcs except through some rather complicated workarounds.


          The TableMinGrp is a nested table calculation that is doing a variation of the Find First/Last/Min/Max problem that I wrote up inhttp://community.tableau.com/thread/137236. My suggestion would be to use one of those techniques to pre-calculate the TableMinGrp so it can be a dimension, potentially an aggregate measure.



          1 of 1 people found this helpful
          • 2. Re: Using a table calculation as a dimension
            Matt Morgan

            I know this is 5 months late, but couldn't you get the cumulative play you are looking for by using the PlayerDay table instead of PlayerSession? I am assuming you are working with IGT, correct? I haven't done this level of detail on table games as they are not large portion of my casino. I am thinking you can get what you want by working with Table_Sessions, Table_Games & Table_CashBuyIn within the PlayerDay table. I know the PlayerSession can give you more info than you want in some circumstances.