7 Replies Latest reply on Aug 22, 2018 9:19 AM by Toby Erkson

    Sending data to R at a finer level of detail than in the table.

    William Hall

      I have a problem I've been wrestling with for a while and am not sure if I'm coming across limitations in Tableau/R or a PEBKAC issue!

       

      Consider a data source that has a metric broken down by multiple dimensions. Exampling from the superstore dataset you might have YoY sales by location, category, order priority.

      An end user views a dashboard and see's YoY sales is below target, and want to drill into the data to find what's driving this. I'd like to be able to direct the user as to which dimensions to drill into by passing the data at full granularity (i.e [location], [category],[priority]), at the current selected filters to R, perform a linear regression fit and test that to see which dimension was the best predictor of the measure. R should return this single value back to Tableau to be displayed to the user

      E.g When the user first opens the dashboard no filters will be selected and R comes back with [priority] as the best predictor of YoY sales. The user looks at an appropriate table and sees this is most pronounced in critical priority orders. The user selects critical priority as a filter and now we want tableau to send YoY sales by [location],[category] and with [priority]="Critical" to R to re-do the analysis and guide the user as to which dimension to drill into next, if appropriate. Either the user can dig further and find out that e.g critical orders are particularly down for Futniture or p-values suggest none of the other dimensions are a good predictor and critical sales are down across the board.

       

      So the above is the problem I'm trying to solve. But to be able to pass data at the appropriate level of detail each dimension must be present on the sheet somehow, which then slices the display up so the returned value gets displayed once for each combination of dimensions instead of once absolutely. How can I pass data to R at a preferred level of detail and return a single value. The examples I've seen around pass data by dimensions and return a label for each value instead of a single value (e.g clustering) or return a single value having been passed parameters instead of dimensions (e.g cancer cell classification).

       

      Any pointers?