Using Data Items in a Report

About Data Items

Each data source in SAS Visual Analytics Designer includes one or more standard data items. You decide which data items to use to define a query for each report object. You can use all the data items in the data source or a subset of data items. Each data item is classified as either a category or a measure.
Data Items That Are Available in SAS Visual Analytics Designer
Data Item
Icon
Description
Calculated
calculated category icon or calculated measure icon
A data item that is calculated from existing data items by using an expression. For example, you could create a calculated data item called Profit, which is created by using this expression: [Revenue] — [Cost], where Revenue and Cost are measures in a data source.
Category
category icon
A data item whose distinct values are used to group and aggregate measures. There are four types of categories: alphanumeric, date, timestamp, and time. Alphanumeric categories can be made up of all letters, all digits, or a combination of the two. Categories that have values that are all digits might be physically stored as character or numeric data. The data type affects how values are handled in relation to some functionality, such as filtering, sorting, and formatting.
Examples of alphanumeric categories include data items such as Product ID, Country, Employee Number, and Employee Name.
Category data items can also be numeric. A category data item sorts differently than an alphanumeric data item. Numeric category data items sort by number.
Note: If you change a measure to a category, then it also uses this category icon.
Date and Time
date time icon
A category data item whose distinct values are used to group and aggregate measures. There are three types of date categories: date, timestamp, and time.
Examples of date, timestamp, and time categories are Order Year, Date of Sale, and Delivery Time.
Geography
geography icon
A data item whose values are mapped to geographical locations or regions. Geography data items can be used in reports show your data on a geographic map. For example, a geography data item can identify geographic information that is specific to your organization (for example, sales regions, warehouse locations, oil platforms, and so on).
Hierarchy
hierarchy icon
A data item whose values are arranged with more general information at the top and more specific information at the bottom. The first level in the hierarchy is the root level. For example, you might have a Time hierarchy, which includes the Year (the root level), the Quarter, and then the Month. You can also have geographic hierarchies.
Measure
measure icon
A data item whose values can be used in computations. These values are numeric. Examples of measures include Sales Revenue, Units Sold, and Salary.
SAS Visual Analytics Designer assigns a default aggregation method to every measure. Almost all measures are assigned sum, but certain formats are assigned an average. You can change the aggregation method.
Note: Report objects that are imported from SAS Visual Analytics Explorer use either live or on-demand data instead of embedded data. Therefore, you can update the properties, styles, and comments for these reports in SAS Visual Analytics Designer, but you cannot change the data assigned to them.

Select Data Items

To select data items to use in queries for the current report section:
  1. On the Data tab in the left pane, click the down arrow to display a list of available data sources. Select a data source and the Data tab is populated with a list of all of the data items that are in the data source.
    If the data source that you want is not in the list, click add data source icon, which displays the Add Data Source window. Select the data source that you want, and then click Add. The Data tab is populated with a list of all of the data items that are in the data source.
    If you do not want to use the data source that you originally selected, click Remove data source. Click Yes in the confirmation message that is displayed.
  2. (Optional) To see more information about a particular data item, select it in the list. The Name, Role, Format, and Aggregation are displayed in the data item table below the list of data items.
    Here is an example of the details for a data item called Engine Size:
    Details about a Selected Measure Data Item
    Details about a Selected Measure Data Item

Duplicate Data Items

Duplicating data items in SAS Visual Analytics Designer enables you to see the aggregations of a data item (Sum, Average, Minimum, Maximum, and Count) side-by-side in a table. If you save a report with duplicate data items, then those data items are available when you edit the report the next time.
You can duplicate a calculated data item. You can also duplicate a category if you want to it to be displayed using a different format.
To duplicate a data item:
  1. On the Data tab in the left pane, right-click the data item that you want to duplicate.
    Duplicate Data Item Menu Selection
    Duplicate Data Item Menu Selection
  2. Select Duplicate Data Item. The data item appears in the list of data items. For example, if the original data item name is Engine Size, then the duplicate data item is displayed as Engine Size (1). If you choose to duplicate the same data item again, then it is displayed as Engine Size (2).
  3. (Optional) Change the format, aggregation, or both for the duplicate item (or items).
  4. (Optional) Rename the duplicate data item (or data items).

Remove Data Items

You can remove data items, including calculated data items, so that they no longer appear in the Data tab in the left pane.
You cannot remove the last copy of a data item or a data item that is being used by a calculated or a geography data item. You cannot remove a data item that is inside a hierarchy, if it reduces the hierarchy to a single level.
To remove a data item (or data items):
  1. On the Data tab in the left pane, right-click the data item that you want to remove.
    Remove Data Item Menu Selection
    Remove Data Item Menu Selection
  2. Select Remove Data Item.
  3. Click Yes in the confirmation message that is displayed. The data item is removed from the list of data items.
    Remove Data Items Message
    Remove Data Items Message

Derive a Distinct Count

A distinct count query is useful in many ways. For example, you might want to know the number of distinct products that were purchased during a specific time period. Or you might want to know which products have the most customers or which products have the most customers in a particular geographic region. You can derive a distinct count for only a categorical data item, including calculated category data items.
To derive a distinct count:
  1. On the Data tab in the left pane, right-click the category data item that you want to use for the distinct count.
  2. Select Derive Distinct Count. The distinct count data item appears in the list of data items.
    Derive Distinct Count Menu Selection
    Derive Distinct Count Menu Selection
    For example, if the original data item name is Date, then the distinct count data item is displayed as Date (Distinct Count). The distinct count icon icon identifies the new distinct count data item on the Data tab.

Create Geography Data Items

A geography data item can be useful if your data contains values that are mapped to geographical locations or regions. For example, a geography data item can identify geographic information that is specific to your organization (for example, sales regions, warehouse locations, oil platforms, and so on).
If you change a numeric measure into a geography data item, then it automatically becomes a category data item.
Note: Calculated data items cannot be turned into geography data items.
To create a geography data item:
  1. On the Data tab in the left pane:
    • Right-click the data item that you want to use for the geography data item. Select Geography.
    • Select the data item that you want to use for the geography data item. In the data item table, select Geography for the Role.
    The Geography window is displayed.
    Geography Window
    Geography Window
  2. Select a measure for the Latitude. You can also enter the first letter of the name of the latitude column to quickly search for it in the drop-down menu.
  3. Select a measure for the Longitude. You can also enter the first letter of the name of the longitude column to quickly search for it in the drop-down menu.
  4. Select a Coordinate space. The choices are World Geodetic System (WGS84), Web Mercator, and British National Grid (OSGB36). The default is World Geodetic System (WGS84).
  5. Click OK. The geography icon icon identifies the new geography data item on the Data tab.

Modify Data Item Properties

Rename a Data Item

To rename a data item:
  1. Select a data item on the Data tab.
  2. In the data item table, select the existing name for the data item and then enter a new name. Your change is saved automatically.

Modify a Data Item’s Role

You can modify a data item’s role. For example, you might want to modify a category data item to be a geography data item. A data item's role cannot be changed if that data item is in use in the report.
To modify a data item’s role:
  1. Select a data item on the Data tab.
  2. In the data item table, select the existing role name for the data item.
  3. Click small down button icon to open the drop-down menu. Select Measure, Category, or Geography. Your change is saved automatically.
    Note: Category data items cannot be converted into measure data items.

Modify the Format of a Measure or a Date-Time Data Item

Note: The format cannot be changed for a data item that is used in a filter or a calculated item.
To change the format of a measure or date-time data item:
  1. Select a measure data item on the Data tab.
  2. In the table, select the existing format. A list is displayed with the Format type, Width, and Decimals. Make your selections. A sample of your selection (or selections) is displayed under the list. Here is an example of the list:
    Available Formats for a Measure Data Item
    Available Formats for a Measure Data Item
    Available Formats for a Date-Time Data Item
    Available Formats for a Date-Time Data Item
    Note: There are different formats available for date, date-time, and time.
  3. Click OK to save your changes.

Modify How a Measure Is Aggregated

You can change the aggregation method for a measure in a data source using either the Data tab or in the canvas.
Note: You need to understand your data, because some aggregation methods are not always appropriate. For example, an average of an average is not valid.
To change the aggregation method using the Data tab:
  1. Select a measure data item on the Data tab.
  2. In the data item table, select the existing aggregation. A drop-down list is displayed with aggregations. Sum, Average, Minimum, Maximum, and Count are the available aggregations. Select one, and your change is saved automatically.
    Note: All report objects in the report that uses this data item are affected by this change, unless you have selected a local aggregation override.
    Available Aggregations for a Data Item
    Available Aggregations for a Data Item
To change the aggregation method when you are working with a report object in the canvas:
  1. Choose one of the following:
    • For a table, right-click a measure header in the report object.
      Aggregation Menu Items for a Table
      Aggregation Menu Items for a Table
    • For a graph, right-click the measure name hotspot.
      Aggregation Menu Items for a Graph
      Aggregation Menu Items for a Graph
  2. Select Aggregationthen selectaggregation name, where aggregation name is Sum, Average, Minimum, Maximum, or Count.
    Your change is saved automatically.
    Note: This is a local override for only this report object. It does not affect the default aggregation for this data item in other report objects.