The company has multi-level Class and Department hierarchy. The Administrator wants to show the total employee headcount to reflect in parent Class and Department only. This data also needs to be added to the dashboard.
Create a Workbook Pivot Table using a Dataset which includes a custom formula that maps sub class and sub department to its parent Class and Department.
First, create a Dataset:
- Click Analytics
- Click Datasets
- Click New Dataset
- Click Employee
- Second column from the left: Click and drag desired employee fields to create dataset criteria filter. See article 82543 Dataset Criteria Filters.
- Upper left side of the page: Click Formulas
- Click New Formula
- Formula Field:
- Formula Field Name: Enter Field Name
Example: Parent Class - Choose Output Type: Select String
- Formula box: Enter the following formula
Note: The custom formula maps from the third level sub class to the first level or parent class. - Case
WHEN {class.parent#display} IS EMPTY THEN {class#display}
WHEN {class.parent.parent#display} IS EMPTY THEN {class.parent#display}
ELSE {class.parent.parent#display}
END - Click Validate
- Click Save
- Click New Formula
- Formula Field:
- Formula Field Name: Enter Field Name
Example: Parent Department - Choose Output Type: Select String
- Formula box: Enter the following formula
Note: The custom formula maps from the third level sub department to the first level or parent department. - CASE
WHEN {department.parent#display} IS EMPTY THEN {department#display}
WHEN {department.parent.parent#display} IS EMPTY THEN {department.parent#display}
ELSE {department.parent.parent#display}
END - Click Validate
- Click Save
- Click and Drag Parent Class to the data grid
- Click and Drag Parent Department to the data grid
- Click Refresh icon
- Click Save
- Save Dataset As: Enter Dataset Title
Example: Headcount per Class and Department - Click Save
- Click Create New Workbook
- Choose Visualization Type: Click Pivot
- Dataset column:
- Click and drag Parent Class to Rows Drop fields
- Click and drag Parent Department to Columns Drop fields
- Click and drag Entity ID to Measures Drop fields
- Click Refresh icon to see updates
- To show total, click Sum icon
- Totaling:
- Placement Rows: Select desired placement
- Click OK
- Upper right side: Click Save
- Save Workbook As: Enter Workbook Title
Example: Headcount per Class and Department - Click Save