In most cases, data can be divided into dimensions and measures, but this division may not always fit according to your visualization requirements. In such cases, you can define and manipulate the dataset by converting Dimensions into Measures, and vice versa. In Arcadia, you can toggle between Dimensions and Measures.
When you convert a dimension into a measure, a string is converted into an integer with the default aggregation function Sum. You can change that to Count or Average and so on. Learn more about aggregate functions here.
Dataset
In this example, you’ll be working with the dataset Employee_Salary_2014
[Data source]. The dataset shows employee salaries in Montgomery County, Maryland, in the year 2014. Because the data is originally in a CSV file, and the CSV format takes all values as strings, the imported dataset shows only dimensions and no measures. This article demonstrates how to convert dimensions into measures, and then change their default aggregate function from Sum to Count.
Prerequisites
You must have access to the dataset that uses Employee_Salary_2014
data. Follow the guidelines in these articles:
Takeaways
In this exercise, you learn how to:
- Manage dataset field attributes
- Expand and collapse field attributes
- Convert Dimensions into Measures
Manage field attributes
- Find and open the specific dataset that uses
Employee_Salary_2014
data. - In the left side navigation menu, click Attributes.
Attributes view appears, and shows the Dimensions and Measures lists.
- If the lists are collapsed, click Expand All at the top of the Measures list.
- Click Edit Attributes at the top of the Dimensions field.
- The Dimensions and Measures lists appear, with editable fields highlighted in blue.
- Convert Dimensions into Measures by clicking Dim to the the left of the field name in these three rows:
Current_annual_salary
2014_gross_pay_received
2014_overtime_pay
The fields now show as Mes (measures).
- Click Save.
- Note that the converted fields appear under the Measures list.
- To change the default aggregate measure function from Sum to Count, click Edit Attributes.
- Under the Measures list, click
current_annual_salary
.
The Column View appears.
- In the Column View, the Default Aggregation shows Sum.
- Click the drop-down icon next to Sum.
- In the drop-down list, click Count.
Alternatively, you can change aggregate functions by manually entering an expression in the Enter/Edit Expression modal.