Working with Data Sources in Reports

About Data Sources

Data sources that are available in the designer are prepared by a data administrator or analyst so that you can easily define a report. Data administrators load tables into memory using SAS Visual Analytics Administrator. Analysts can use SAS Visual Data Builder (the builder) to design queries that load tables into memory too. All data sources contain data items, which can refer to calculations or columns in physical data (tables). Reports can include query results from more than one data source.

Add a Data Source to a Report

You can use one or more data sources in a report in the designer.
To add a data source to a report:
  1. On the Data tab, click menu down arrow beside the Select a data source text to display the Add Data Source window.
    Data Tab
  2. In the Add Data Source window, select a data source.
    Tip
    Use the Search field to narrow the list of data sources that are displayed in the Add Data Source window. The search searches the Name and Description fields.
  3. Click Add. The list of available data items is displayed in the Data tab.
  4. (Optional) To add another data source, click the add data source button, 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.

Import a Data Source for a Report

If you have the Import and Load Data capability, then you can import a data source into the designer. Acceptable files are SAS data sets, Microsoft Excel spreadsheets, and delimited text files, such as CSV files.
When you import data, the data source is automatically added to the open report.
To import a data source for a report:
  1. On the Data tab, click the Import button. The Select file to upload by window is displayed.
  2. Select a data source (or data sources) that you want to import. The Import Local File window is displayed.
    If you select a delimited text file, then you can specify additional options. For example, you can specify the delimiter, whether the first row contains column heading names, and where the data rows begin.
    If you select a spreadsheet, then you can specify additional options. For example, you can specify which worksheets to import, whether the first row contains column heading names, and where the data rows begin.
  3. Click OK.
Note: You cannot rename an imported data source unless there is a filename conflict.
You can also import data using the Add Data Source window or the Change Data Source window. The Add Data Source window allows you to import multiple data sources. However, the Change Data Source window only allows you to import one data source.

Refresh a Data Source for a Report

You can refresh the columns in a data source in the designer at any time. Be aware that refreshing a data source means that all live report objects that are connected to that data source will have their queries re-run.
Note: Refreshing a data source adds any new columns that have been added to the table metadata. The default formats and names of existing columns will be updated the next time you open the report.
To refresh a data source for a report, on the Data tab, select the data source, and then click the refresh data button. When you refresh a data source for a report, columns that have been deleted from the table metadata will automatically be removed if they do not impact any objects in the report. If deleted columns do impact objects in the report, then the Repair Report window is displayed so that you can repair the objects that are impacted by the deleted columns.For more information, see Repairing Reports.

Remove a Data Source from a Report

You can remove a data source from a report in the designer. Be aware that removing a data source means that all related data items are also removed from the report objects within the report.
To remove a data source for a report:
  1. On the Data tab, select the data source, and then click the delete button.
  2. Click Delete in the confirmation message that is displayed.

Change a Data Source in a Report

To change a data source for a report:
  1. On the Data tab, click the action button and then select Change Data Source. The Change Data Source window is displayed.
  2. In the Change Data Source window, select a data source.
  3. Click Change.
    If a data item with the same name does not exist in the replacement data source, then it is automatically removed from the replacement data source if there are no report objects that use the data item. If there are report objects that use the data item, then those report objects will not work. The Repair Report window is displayed so that you can repair the objects that use the data item. For more information about repairing reports, see Repairing Reports.
    Data items in the replacement data source that have names that do not exist in the original data source are added to the Data tab automatically.
    Note: For data item names, the case is ignored when data sources are compared by the designer.

Viewing Measure Details

To view the details about all of the measures in a data source:
  1. On the Data tab, click the action button and then select Measure Details. The Measure Details window is displayed.
  2. Click Close.

Showing or Hiding Items

You can specify which data items you want to see for the data source in the Data tab.
To show or hide data items:
  1. On the Data tab, click the action button, and then select Show or Hide Items. The Show or Hide Data Items window is displayed.
  2. Select the data items that you want to appear on the Data tab. If there are data items that you do not want to see on the Data tab, then clear the check box (or check boxes) for that data item (or data items).
  3. Click OK. The Data tab is updated.
Alternatively, you can select a data item that you want to hide on the Data tab. Right-click the data item, and select Hide Data Item.
You can also use a data source filter to restrict the data that is displayed in a report. For more information, see Working with Data Source Filters in a Report.

Sort Items

To sort data items on the Data tab, click the options button, and then select one of the following:
  • Sort Itemsthen select Ascending By Name
  • Sort Itemsthen select Descending By Name
The data items are sorted on the Data tab within each grouping. The default sort is Ascending By Name.
For information about sorting data values in report objects, see Sorting Data in Reports.

Group Items

To group data items on the Data tab, click the options button, and then select one of the following:
  • Group Itemsthen select By First Letter
  • Group Itemsthen select By Data Type
  • Group Itemsthen select By Role
  • Group Itemsthen select By Format
  • Group Itemsthen select By Aggregation
The data items are grouped on the Data tab. The default is grouping By Role.