In the following example, note that Sales on the right axis is set to Quick Table Calculation | Moving Average. Calculating a moving average, running total, or other such comparison calculations can be quite challenging to accomplish in a data source. Not only must a data architect consider what comparison calculations to include in the data source, but they must also determine dimensions for which these calculations are relevant. VizQL greatly simplifies such challenges via table calculations:
The relevant portion of SQL generated by the preceding worksheet shows that the table calculation is not performed by the data source. Instead, it is performed in Tableau by the VizQL module:
SELECT SUM([Orders$].[Sales]) AS [sum:Sales:ok],
DATEADD(month, DATEDIFF(month, 0, [Orders$].[Order Date]), 0) AS [tmn:Order Date:ok]
FROM [dbo].[Orders$] [Orders$]
GROUP BY DATEADD(month, DATEDIFF(month, 0, [Orders$].[Order Date]), 0)
To reiterate, nothing in the preceding call to the data source generates the moving average. Only an aggregated total is returned and Tableau calculates the moving average via VizQL.
DHE takeawaysThis overview of the Tableau Data-Handling Engine (DHE) demonstrates a flexible approach to interfacing with data. Knowledge of the DHE helps understand the parameters for Tableau data readiness. Two major takeaways from this section are as follows:
It is not necessary to explicitly define data types and roles for optimal Tableau usage
Comparison calculations such as moving averages and running totals can be addressed by table calculations in Tableau and thus do not need to be calculated in advance
Knowledge of these two takeaways can reduce data preparation and data modeling efforts, and thus help streamline the overall data mining lifecycle.
Comments
Please log in or sign up to comment.