Tag Archives: aggregations

Aggregations

Using ATTR()

Nice description of ATTR() here:
http://community.tableausoftware.com/thread/116788

Another description of ATTR() and Level of Detail:

http://community.tableausoftware.com/message/223211#223211

Evaluation to see if ATTR() is returning *:
IF NOT ISNULL(ATTR([Market])=”*”) THEN “Here” END
From Joe Mako’s post in this thread: http://community.tableausoftware.com/thread/108930
How this calc works, from Joe: “…if the result of comparing the ATTR() to a string is NULL, than I know the ATTR() function is displaying a “*”.”

Note – if the field is not a string datatype, then use:
IF NOT ISNULL(STR(ATTR([otherfield]))=”*”) THEN “Here” END

Using ATTR() to determine current level in an expanded/collapsed hierarchy
http://community.tableausoftware.com/thread/119146

Can also do a check like this to see if ATTR() in Primary matches ATTR() in Secondary:
IF ATTR([Market]) = ATTR([Sample – CC Extract (Access)].[Market]) THEN “Match” ELSE “No Match” END

Including Group Results as Reference Lines in Individual Results

  1. Do things the way I initially did – generate the results for the population in a worksheet, export those results, and then reimport them into the data set either by joins or blends.
  2. Do a whole bunch of table calculations, which can get really slow.
  3. Use data blends and do a self-join back to the data source and then create calculated fields to get the population results. The only challenge here is that whatever Filters are used against the original data have to be duplicated inside the calculation. Whenever the underlying data is updated, every data source will need to be refreshed. (This last point can go away in Tableau 7).
  4. A variation on #3 when using extracts, instead of re-linking back to the original data source, when adding the 2nd data source point to the TDE file instead. This means that whenever the extract is updated, all the results will be updated.
  5. RAWSQLAGG or Custom SQL is another possibility.

For example, in AHRQ outpatient survey, to do the office type & composite reference line, duplicate the data source, and join back to the original on office type & composite.
Another example, from Blood Transfusion, where the display is an aggregate and the reference lines need to be based on the original data.
• Distribution of Hgb view has Date and Hgb on Rows shelf, # Transfusions on columns
• Duplicate data source or add the TDE
• Add the necessary measures, probably don’t need table calcs since the blend is a left-join and will return all rows


Table that shows MIN MAX and AVG for several measures - Added January 14, 2015

Nice discussion on text tables and profiling multiple measures: http://community.tableausoftware.com/message/319156#319156


Related posts:

  • How to Have Sets with Your Secondary (Data Sources)
  • Table Calculations
  • Tricks + Miscellaneous Techniques
  • Preparing Data
  • Partitioning by Table Calculations
  • Unexpected Results: Rounding
  • Customizing Grand Totals - Part 2putting grand total together
  • Customizing Grand Totals - Part 1Grand Total Dashboard