Creating an attribute based on existing objects: Derived attributes

You can create and add derived attributes to a dashboard, based on dataset objects that already included in the dashboard. For example, you can combine the geographical region attribute with the state attribute to produce a result like Chicago, Illinois. (To do this, you would use the concatenation function.) A derived attribute works the same as any other attribute. You can add it to a visualization, drag it into a text field to display it as a label, or use it as a filter.

You can easily create a derived attribute that:

You can also create more complex derived attributes, using the functions available in the Attribute Editor. For example, your dashboard contains the Employee attribute, which contains separate attribute forms for the first name and last name of each company employee. (An attribute form is a descriptive category for any data that you save about any of its attributes.) You want to display the first initial and last name of each employee. You can create a derived attribute based on Employee, using the Concatenation function to combine the first letter of the first name and the last name. The derived attribute has the following definition:

Concat(Leftstr(Employee@First  Name,1),.,

When the derived attribute is displayed in a visualization, it displays each employee by first initial and last name.

You can use a derived attribute to turn a Salary metric into a Salary Range attribute. Define the attribute’s values as salary bands, such as 20K and 50K. Create a derived attribute with the following definition:

Concat(LeftStr(toString(Salary), (

To display the salary bands in thousands, change the definition to the following:

Concat(LeftStr(toString(Salary), (

For steps, see Attribute Editor.

By default, a derived attribute contains only the ID attribute form, but you can define additional attribute forms for the derived attribute. Any attribute forms besides the ID attribute form must be based on the value of the ID attribute form.

Sorting is one reason to create an additional form rather than another derived attribute. For example, your dataset contains a Date attribute in the format MM/DD/YY. You need to display the days of the week rather than the date. You can create a derived attribute that performs this transformation, returning values of Monday, Tuesday, and so on. If you sort these values alphabetically, Friday would display first. You want Sunday, the first day of the week, to display first, followed by Monday, and so on. You can create the derived attribute with these two forms:

DayOfWeek(Date@ID)

ToString<Pattern=ddd>(Date@ID)

The derived attribute, when displayed in a visualization, sorts according to the ID form.

Steps to define attribute forms are included in Attribute Editor.

Prerequisite

The steps below assume you have already created the dashboard to add the derived attribute to. For steps, see Creating a dashboard.

 

To change the data type by creating a derived attribute:

  1. Click the name of the dashboard to run it.

  2. When you create a derived attribute, you can also add the derived attribute immediately to a specific visualization to be displayed. Do one of the following:

Your derived attribute is created and added to the dashboard.

 

To create a derived attribute based on a metric:

  1. Click the name of the dashboard to run it.

  2. In the Datasets panel, right-click the metric and select Duplicate as Attribute. A new attribute is created based on the metric and displayed in the Datasets panel. Each value in the metric is displayed as a separate element in the attribute. The original metric is not modified and remains on the dashboard. Note: If the Datasets panel is not displayed, from the View menu, select Dataset Panel.

Related topic

Creating a dashboard

Dynamic links in a Grid visualization

 

 

_____________________________