Friday, March 8, 2013

[TABLEAU] Using The Same Measure With Different Aggregations



Using the Same Measure with Different Aggregations
To include the same measure in two or more aggregations as a default. For example, you might need the sum of Sales and the average of Sales on multiple views. 
You can move the Sales field to the view, modify the aggregiation, and repeat for each aggregation. If you want to use the same aggregiations repeatedly, you may wish to setup custom fields to make these aggregations automatically available.


Creating two different default aggregations for same measure

Step 1
Open a new workbook and connect to the Superstore sample.

Step 2
In the Measures pane, right-click the measure and select Duplicate.




Now you have Sales and Sales (copy).


Step 3
Right-click Sales (copy) and select Field Properties > Aggregation > Average.





Step 4
Right-click Sales (the original) and select Field Properties > Aggregation > Sum.


Step 5
In the Dimensions pane, right-click Measure Names and select Field Properties > Aliases.
The duplicate Sales measure now appears in the Edit Aliases dialog box.




Step 6
In the Edit Aliases dialog box, in the Member list, click Sales (copy).

Step 7
Replace Sales (copy) with Averaged Sales.

Step 8
Do the same with Sales, replacing it with Total Sales.




Step 9
When finished, click OK.

Step 10
From the Dimensions pane, drag Measure Names onto the Filters shelf.
In the Filter dialog box, both Averaged Sales and Total Sales are listed.






Step 11
Click OK.

Step 12
From the Measures pane, drag Measure Values onto the Text shelf of the Marks card.

On the Measure Values shelf, the two Sales measures appear. Their names have not changed; the actual measure's name does not change (although the aggregation label (SUM, AVG, etc.) changes as appropriate).









No comments:

Post a Comment