Products | Versions |
---|---|
Spotfire Analyst | All Versions |
Hierarchy Labels:
You can edit the expression used by the 'Hierarchy' axis of your tree map and actually perform the mathematical calculation of the percentage there. Access the expression used for the Hierarchy here:
<[TEAM]>This will result in the labels showing just the values of the [TEAM] column in each of the rectangles. For example: N.Y.
But you can also perform calculations on the data and display the results as a string to show data in the labels. For example, this will show what percentage each team contributes to the total [HOME_RUNS]:
<[TEAM] & " (" & (Sum([HOME_RUNS]) OVER ([TEAM]) / Sum([HOME_RUNS]) * 100) & "%)">
This will result in the labels showing the values of the [TEAM] column in each of the rectangles with the addition of a percentage. For example: N.Y. (9.16%)
Explanation:
Note: This will not work for Hierarchy columns.
Tooltips:
It is also possible to perform similar calculations on the total data set in tooltips. To show the same percentage of total [HOME_RUNS] for each [TEAM]. To add a new tooltip value:(Sum([HOME_RUNS]) / Sum([HOME_RUNS]) over (All([Axis.Hierarchy])) * 100) & "%" as [Percent of Total]
Example:
See the attached screenshot (Filename: Tree_Map_-_How_to_Show_Percentages_of_Total_in_Label_and_Tooltip.png and Tree Map - How to Show Percentages of Total in Label and Tooltip.dxp) for an example implementation (v6.5).
Note: This will not work with external data (in-database). The data table must be imported and handled in-memory.