Hello,
I am working on a viz with heirarchical variables akin to 'Product Name' and 'Product Category' as adjacent rows. The measures are lower and upper confidence values for a given mean value, plotted per product name (ie averages per cell).
These confidence intervals are then visually compared in the viz to the lower and upper confidence intervals for the Category-level mean value (ie averages per pane). The Category-level confidence intervals are displayed as reference bands so as to allow simultaneous display with the Product-level values, which are plotted as marks.
I would like to calculate a new value called 'Outlier', which codes a value of say either -1, 0, or 1 for each product. '-1' would mean a below outlier, which is when the Product-level upper CI is smaller than the Category-level lower CI. '1' would mean an above outlier, which is when the Product-level lower CI is greater than the Category-level upper CI. '0' would be non-outliers, ie all other cases.
This should have been straightforward to code except for the fact that I don't know of any way to reference a table calculation performed in a reference band in my 'Outlier' calculated field. I also don't know how to specify in a calculated field's syntax that I want to compare the average of a measure by CELL against the average of that same measure by PANE. Any help would be much appreciated.
Thanks!
I'm not sure if you're using the Tableau built-in reference line calculations or built-your own, it sounds like you're using the built-in reference line calculations. We don't have access to those results in our own calculations, so what you have to do is build your own computations to build the reference lines/bands. Then you can create a nested table calculation that does the comparison.