The crosstab tool allows you to pivot and summarize data similar to a pivot table in Excel. To provide some context. In the previous table, we only calculated one group of data on the vertical axis, which was department ID. And we did one calculation which was to count employees. To take it one step further. In this example, we're going to calculate the average age of each role in each department.
So we essentially have two groups of data now, ie the department ID on the vertical axis, and the position of the employee on the horizontal axis. Let's start a new workflow by importing our 5.2 spreadsheet, we'll go to the Insert tab, drag in the input data tool and select 5.2 cross tab. We again have our employee HR file, but this time I've added a new column called position to determine if an employee is a manager or analyst will now go to the transform tab and drag in the cross tab tool. In the configuration pane on the left, we have the option at the top to group our data along the vertical axis. So the field we want to group by is department ID. So we'll select that.
Next, we have to choose the column headers that we'd like to see at the top. And because we want to see it by position, we'll select position to be the column and the values we want to see age. So we'll select that and the method for aggregating values will be average. So let's add a browse tool to the end with Ctrl Shift B and run our workflow with Ctrl R. And as you can see, we now have a pivot table which shows us the average age of each position by department.