Oracle® Fusion Middleware

User's Guide for Oracle Data Visualization

E57762-02

December 2015

Oracle Fusion Middleware User's Guide for Oracle Data Visualization

E57762-02

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Primary Author: Suzanne Gill

Contributing Authors: Rosie Harvey, Christine Jacobs

Contributors: Oracle Business Intelligence development, product management, and quality assurance teams

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Contents

Preface

- Audience

- Related Resources

- Conventions

1 Getting Started with Oracle Data Visualization

- About Oracle Data Visualization

- About Visual Analyzer

- Accessing Visual Analyzer

- What is the Home Page?

- Searching for Content in Visual Analyzer

2 Exploring Your Content

- Typical Workflow for Exploring Content

- Choosing Data Sources

- Adding Data Elements to Visualizations

- Adding Data Elements to Drop Targets

- Adding Data Elements to Visualization Drop Targets

- Adding Data Elements to a Blank Canvas

- Adjusting the Canvas Layout

- Changing Visualization Types

- Adjusting Visualization Properties

- Undoing and Redoing Edits

- Reversing Visualization Edits

- Refreshing Visualization Content

- Exploring Data Using Filters

- About Filters

- About Filter Types

- About Automatically Applied Filters

- Creating Filters

- Applying Range Filters

- Applying List Filters

- Applying Date Filters

- Building Expression Filters

- Exploring Data in Other Ways

- About Composing Expressions

- Creating Calculated Data Elements

- Specifying How Visualizations Interact with One Another

3 Adding Your Own Data

- Typical Workflow for Adding Data from External Sources

- About Adding Your Own Data

- About Characteristics for External Sources

- Adding Data from External Sources

- Blending Data that You Added

- Refreshing Data that You Added

- Updating Details of Data You Added

- Controlling Sharing of Data You Added

- Removing Data that You Added

- Deleting Data that You Added

- Managing Data Files

A Expression Editor Reference

- SQL Operators

- Conditional Expressions

- Functions

- Aggregate Functions

- Calendar Functions

- Conversion Functions

- Display Functions

- Evaluate Functions

- Mathematical Functions

- String Functions

- System Functions

- Time Series Functions

- Constants

- Types

Preface

Topics:

Learn how to use Oracle Data Visualization to explore and analyze your data.

- Audience

- Related Resources

- Conventions

Audience

Users Guide for Oracle Data Visualization is intended for business users who plan to use Oracle Data Visualization to upload and blend data for analysis, explore data within visualizations, and work with their favorite projects.

Related Resources

See the Oracle Business Intelligence documentation library for a list of related Oracle Business Intelligence documents.

In addition:

- Go to the Oracle Learning Library for Oracle Business Intelligence-related online training resources.

- Go to the Product Information Center support note (Article ID 1267009.1) on My Oracle Support at https://support.oracle.com.

Conventions

The following text conventions are used in this document:

Convention

Meaning

boldface

Boldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary.

italic

Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values.

monospace

Monospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter.

1 Getting Started with Oracle Data Visualization

This topic describes how to get started with Oracle Data Visualization.

Topics:

- About Oracle Data Visualization

- About Visual Analyzer

- Accessing Visual Analyzer

- What is the Home Page?

- Searching for Content in Visual Analyzer

About Oracle Data Visualization

Oracle Data Visualization makes it easy for you to quickly explore your data and discover meaningful insights. It includes tools to help you analyze data in your Oracle Business Intelligence repository as well as data outside the repository, with easy to use visualization and data management tools.

About Visual Analyzer

Visual Analyzer is the primary data visualization tool in Oracle Data Visualization.

Accessing Visual Analyzer

You access Visual Analyzer from the Oracle Business Intelligence Home page.

From the Home page, you can access Visual Analyzer in multiple ways:

- In the Create list, click Visual Analyzer Projects to go to a new canvas.

- In the thumbnails, click a Visual Analyzer project.

Note:
You can also use the Visual Analyzer Home page to launch the application. For more information, see What is the Home Page?

What is the Home Page?

If your organization has purchased Oracle Visual Analyzer, the Home page is your access point for Oracle Business Intelligence Classic, Visual Analyzer, the Oracle Business Intelligence Academy, and the Oracle Business Intelligence Administration console.

The Home page is also where you can search for existing items such as data elements, and instantly generate data visualizations using search terms.

Searching for Content in Visual Analyzer

Visual Analyzer enables you to quickly and easily search for content to use in projects. Just enter the characters in a Search field, and Visual Analyzer automatically begins the search.

For example, you can use the Search field in the Data Elements pane to find all data elements that contain the word “Revenue”. Visual Analyzer returns matching results that are included in the data sources associated with the project.

You can also use the Search field in the Data Sources pane to search for data source names and column names contained in uploaded data source files, and in the Visualizations pane to search for visualization types by name.

For more information about searching in the Visual Analyzer Home page, see What is the Home Page?

2 Exploring Your Content

This topic describes how to explore your content.

Topics:

- Typical Workflow for Exploring Content

- Choosing Data Sources

- Adding Data Elements to Visualizations

- Adjusting the Canvas Layout

- Changing Visualization Types

- Adjusting Visualization Properties

- Undoing and Redoing Edits

- Reversing Visualization Edits

- Refreshing Visualization Content

- Exploring Data Using Filters

- Exploring Data in Other Ways

- About Composing Expressions

- Creating Calculated Data Elements

- Specifying How Visualizations Interact with One Another

Typical Workflow for Exploring Content

Here are the common tasks for exploring content.

Task

Description

More Information

Select data sources

Select subject areas or external data sources for a project.

Choosing Data Sources

Add data elements

Add data elements from a selected data source to visualizations.

Adding Data Elements to Visualizations

Adjust the canvas layout

Add, remove, and rearrange visualizations.

Adjusting the Canvas Layout

Filter content

Streamline the content shown in visualizations.

Exploring Data Using Filters

Set visualization interaction properties

Specify how visualizations synchronize.

Specifying How Visualizations Interact with One Another

Choosing Data Sources

Before you can begin to explore data in a project, you must select the source for that information. For example, if you want to explore product sales by region, you can select the Sample Sales subject area as the data source. You can select subject areas or uploaded data files such as Microsoft Excel spreadsheets as your data sources.

To choose data sources in a project:

1. In the Add Source dialog, select a subject area or a saved file, or upload a file that contains the measures and attributes you want to visualize. This dialog opens automatically when you create a new project.
See also Adding Data from External Sources.

2. Click Add to Project.

Note:
To add data sources to an existing project, click the Data Sources pane, and then click the Add Data Source link.

Adding Data Elements to Visualizations

This topic describes how you add data elements to visualizations.

Topics:

- Adding Data Elements to Drop Targets

- Adding Data Elements to Visualization Drop Targets

- Adding Data Elements to a Blank Canvas

Adding Data Elements to Drop Targets

After you select the data sources for your project, you can begin to add data elements such as measures and attributes to visualizations.

Note:
To toggle the Explore pane on or off, click the Explore button on the project toolbar.

Here are some of the ways you can add data elements to drop targets:

- You can drag and drop one or more data elements from the Data Elements pane to drop targets in the Explore pane or double click data elements in the Data Elements pane to add them.

The data elements are automatically positioned in the best drop target in the Explore pane, and the visualization type may also change to optimize the visualization layout.

Note:
You can press the Ctrl key to select multiple data elements at a time.

- You can replace a data element in the Explore pane by dragging it from the Data Elements pane and dropping it over an existing data element already in the Explore pane.

- You can swap data elements in the Explore pane by dragging a data element already inside the pane and dropping it over another data element in the pane.

- You can remove a data element from the Explore pane by clicking the X in the data element token.

Note:
If you add an attribute to the Color drop target, you only see discrete colors displayed in the canvas, whereas if you add a measure to that drop target, it only displays shades of a single color. When you perform these same actions on a Pivot visualization, the result is a heat map.
If you add multiple measures to the Values drop target, most of the visualizations display in a discrete color for each measure.

Adding Data Elements to Visualization Drop Targets

You can use visualization drop targets to help you position data elements in the optimal locations for exploring content.

To add data elements to visualization drop targets:

- If you drag and drop a data element over to a visualization (but not on a specific drop target), a blue outline displays around the recommended drop targets in the visualization. If you drop the data element in the visualization, it is automatically shuttled to the best drop target.

Also, you see a green plus icon next to the data element when it is over a valid drop target.

Note:
If you are not sure where to drag and drop any data element, simply drag and drop the data element anywhere over the visualization, and not to a specific drop target. The data element is automatically added to the best drop target in the canvas.

After you drop data elements into visualization drop targets or when you move your cursor outside of the visualization, the drop targets disappear.

- To display the drop targets again in the visualization, in the visualization toolbar, click Show Assignments. You can also do this to keep the visualization drop targets in place while you work.

For more information on adding, removing, or moving data elements, see Adding Data Elements to Drop Targets.

Adding Data Elements to a Blank Canvas

You can add data elements directly from the Data Elements pane to a blank canvas.

To add data elements to a blank canvas:

Drag one or more data elements to a blank canvas or between visualizations in the canvas. A visualization is automatically created and the best visualization type and layout are selected. For example, if you add time and product attributes and a revenue measure to a blank canvas, the data elements are placed in the best locations and the visualization type of Line is selected.

Note:
If there are visualizations already in the canvas, then you can drag and drop data elements between them.

Adjusting the Canvas Layout

You can adjust the look and feel of visualizations in the canvas to make them more visually attractive. For example, you can create a visualization and then copy it to the canvas. You can then modify the data elements in the duplicated visualization, change the visualization type, and then resize it.

To adjust the canvas layout:

- To add additional visualizations to the canvas, click the Visualizations icon, and from the Visualizations pane, drag and drop a visualization type to the canvas. Alternatively, on the project toolbar, click Add Visualization. You can then position the new visualization adjacent to a single visualization or spanning multiple ones.

- To delete a visualization from the canvas, right-click it and select Delete Visualization.

- To rearrange a visualization in the canvas, drag and drop the visualization to the location (the space between visualizations) where you want it to go. The target drop area is highlighted in blue.

- To resize a visualization, use your cursor to drag the edges to size it.

- To copy a visualization in the canvas, right-click it and select Copy Visualization.

- To paste a copied visualization in the canvas, right-click the canvas and select Paste Visualization.

Changing Visualization Types

You can change visualization types to maximize the graphical representation of the data you are exploring.

The visualization type is automatically chosen based on the selected data elements. However, this is only true when you create a new visualization by dragging data elements to a blank area in the canvas. Once a visualization is created, dragging additional data elements to it won’t change the visualization type automatically.
To change visualization types:

1. Select a visualization on the canvas, and in the visualization toolbar, click Change Visualization Type.

Note:
You can also add a new visualization to the canvas by dragging it from the Visualizations pane to the canvas.

2. In the View Select dialog, select a visualization type. For example, change the visualization type from Bar to Stacked Bar.

Note:
You can choose any visualization type, but the visualization types that are displayed in blue are the recommended ones based on the data elements you select and where they are positioned on the canvas.

When you change the visualization type, the data elements are moved to matching drop target names. If an equivalent drop target does not exist for the new visualization type, then the data elements are moved to a drop target labeled Unused. You can then move them to the drop target you prefer.

Adjusting Visualization Properties

You generally don’t need to change visualization properties as the default selections cover most cases. You might want to make adjustments such as hiding the legend, or changing axis labels.

To adjust properties for a visualization:

1. In the active visualization toolbar, click Actions, and then select Properties to display the Properties dialog.

2. On the General tab, select the options to specify title formatting and enable and position the legend for the visualization.

3. In the dialog, click the Axis tab.

4. On the Axis tab, select options that affect the axis label titles and the axes start and end values.

5. In the dialog, click the Values tab.

6. On the Values tab, select the appropriate options to specify how you want values handled in the visualization.

Field

Description

Aggregation Method

Specifies the method for aggregating data in the visualization, such as Auto, Sum, or Average.

Number Format

Specifies number formatting in the visualization, such as Auto, Percent, or Currency.

7. In the dialog, click the Analytics tab.

8. On the Analytics tab, click Add and then select Add Reference Line to set reference lines and bands that display at minimum or maximum values of a measure included in the visualization. You can also select Add Trend Line.

9. In the dialog, click the Edge Labels tab.

10. On the Edge Labels tab, expand a data element in the visualization, and set Show Total to On to display row or column totals in the visualization or Off to hide them.

Undoing and Redoing Edits

You can quickly undo your last action and then redo it if you change your mind. For example, you can try a different visualization type when you don’t like the one you have just selected, or you can go back to where you were before a drill. These options are especially useful as you experiment with different visualizations.

To undo and redo visualization edits:

Click the Undo Last Edit or Redo Last Edit buttons on the project toolbar.

Note:
You can also press Ctrl+Z to undo an edit and Ctrl+Y to redo it.

Reversing Visualization Edits

You can easily back out of the edits you make in a project. For example, if you move data elements to different drop targets in a visualization, and you decide you don’t like those changes, you can easily reverse your changes.

To reverse any edits that you made in a project since you last saved it:

Click Canvas Settings on the project toolbar and select Revert.

Refreshing Visualization Content

To see whether a newer set of data is available for exploration in a project, you can refresh the data source data and metadata.

To refresh the data and metadata displayed in a project:

- Click Canvas Settings on the project toolbar and select Refresh Data.
This action clears the data cache and reruns queries to retrieve the latest data from the data sources to display in the canvas.

- Click Canvas Settings on the project toolbar and select Refresh Metadata and Report.
This action refreshes the data and also any project metadata that has changed since you started working in it. For example, a column is added to the subject area used by the project. You use this menu to bring the new column into the project.

Exploring Data Using Filters

This topic describes how you explore your content using filters.

Topics:

- About Filters

- About Filter Types

- About Automatically Applied Filters

- Creating Filters

- Applying Range Filters

- Applying List Filters

- Applying Date Filters

- Building Expression Filters

About Filters

Filters reduce the amount of data shown in visualizations. Filters also determine the data set for all the visualizations in the canvas.

When you have multiple filters in the filter bar, you can re-order them by dragging them to different placements.

If visualizations are connected with a master-detail relationship, then you can click data in the master visualization to filter the detail visualization.

Note:
The filters in the filter bar at the top of the canvas filter all visualizations in the canvas. If you turn off Synchronize Visualizations, then a smaller filter bar is added above each visualization. This smaller filter bar applies only to that visualization. For more information, see Specifying How Visualizations Interact with One Another.

About Filter Types

You can apply filters of various types including Range, List, Date, and Expression. Filter types are automatically assigned based on the type of data you are filtering by.

Here are the filter types you can use to explore content:

- Range filters are applied to data elements that are measures. Range filters limit data to a range of contiguous values, such as revenue of $100,000 to $500,000. Use histogram sliders for range filters to interactively adjust the range so as to understand how it relates to the value’s distribution. See Applying Range Filters.

- List filters are applied to all data elements that are dimensions, except for those of type Date. List filters limit data when you want to select discrete members of data elements. See Applying List Filters.

- Date filters use calendar controls to adjust time or date selections. You select a single contiguous range of dates. See Applying Date Filters.

- Expression filters enable you to set advanced filtering across multiple data elements. See Building Expression Filters.

About Automatically Applied Filters

The Auto-Apply option is set by default on list filters that you add.

When Auto-Apply Filters is on (checked), the selections you make in the filters are applied directly as you are in the process of making them. When Auto-Apply Filters is off (unchecked), the selections you make in the filters are not applied to the canvas until after you click the Apply button in the bottom-right corner of the list filter panel.

You can turn off Auto-Apply for list filters by hovering your mouse over the top right of the filter bar, clicking the Actions icon, and selecting Auto-Apply Filters.

Creating Filters

You can create filters explicitly, but filters can also be created implicitly as a result of other actions such as drilling on a visualization.

To add a filter to a project:

- From the Data Elements pane, drag a data element to the filter bar.

- From the Data Elements pane, right-click a data element and select Create Filter.

- From the Explore pane, drag a data element to the filter bar.

- Optionally, add an expression filter as described in Building Expression Filters.

Note:
When you work with visualizations that are part of master-detail relationships, your data selections in the master visualization apply a filter to all the other visualizations in the canvas. For more information on master-detail relationships and synchronizing visualizations, see Specifying How Visualizations Interact with One Another.

Applying Range Filters

Once you add a range filter to a visualization, you then can change the selections it includes.

To use a range filter:

1. In the filter bar, click the filter to view the Range list.

2. In the Range list, click By to view the Selections list.
All members that are being filtered in the canvas have check marks next to their names.

3. Optionally, in the Selections list, for any selected member you want to remove from the list of selections, click the member.
The check mark disappears next to the previously selected member.

4. Optionally, in the Selections list, for any non-selected member you want to add to the list of selections, click the member.
A check mark appears next to the member you selected.

5. Optionally, set the range you want to filter on by moving the sliders in the histogram. The default range is from minimum to maximum, but as you move the sliders, the Start field and End field adjust to the range you set.

6. Click off the filter to close the filter panel.

Applying List Filters

Once you add a list filter to a visualization, you can change the selected members it includes.

To use a list filter:

1. In the filter bar, click the filter to view the Selections list.

2. Optionally, to the left of the Selections list, use the Search field to find the members you want to add to the filter.

3. Scroll down the list of members (or through the Search results) and click once on a member to add it to the Selections list.

4. Optionally, add more members to the Selections list.

5. Optionally, in the Selections list, you can click a member to remove it from the list of selections, causing the member to be filtered out of the canvas.

6. Optionally, in the Selections list, you can click the eye icon next to a member to cause it to be filtered out of the canvas but not removed from the list of selections.

7. Optionally, in the Selections list, you can click the actions icon at the top, and select Exclude Selections to exclude those members from the list of selections.

8. Optionally, click Add All or Remove All at the bottom of the filter panel to add or remove all members to or from the Selections list at once.

9. Click off the filter to close the filter panel.

10. Optionally, to clear the filter selections or remove all filters at once, right-click in the filter bar, and then select Clear Filter Selections or Remove All Filters.

11. Optionally, to remove a single filter, right-click the filter in the filter bar, and then select Remove Filter.

Applying Date Filters

Once you add a date filter to a visualization, you can change the selections it includes.

To use a date filter:

1. In the filter bar, click the filter to view the Calendar Date list.

2. In Start, select the date that begins the range on which you want to filter.
Use the Previous arrow and Next arrow to move backward or forward in time, or use the drop-down lists to change the month or year.

3. In End, select the date that ends the range on which you want to filter.

4. Optionally, to start over and select new dates, in the filter, click the Action icon and then select Clear Filter Selections.

5. Click off the filter to close the filter panel.

Building Expression Filters

If you want a free-form filter, you can build an expression. An expression filter is a special type of filter that allows you to specify the filter in the form of an expression that may reference one or more data elements. For example, you can create the expression filter "Sample Sales"."Base Facts"."Revenue" — "Sample Sales"."Base Facts"."Target Revenue". After applying this filter, you only see the items that did not achieve their target revenue.

You build expressions using Expression Builder. You can drag and drop data elements, and then choose operators to apply. Expressions are validated for you before you apply them.

To build an expression filter for an attribute or measure:

1. In the filter bar, click the Action icon and then select Add Expression Filter.

2. In the Expression Filter panel, compose an expression. For more information, see About Composing Expressions.

3. In the Label field, give the expression a name.

4. Optionally, click Validate to check if the syntax is correct.

5. Fix any errors, if necessary.

6. Click Apply. The expression is applied to the visualizations on the canvas.

7. Click off the filter panel to view your results on the canvas.

You can also use Expression Builder to create calculations, but this is different from creating expression filters. For more information on creating calculations, see Creating Calculated Data Elements.

Exploring Data in Other Ways

While adding filters to visualizations helps you narrow your focus on certain aspects of your data, you can take a variety of other analytic actions to explore your data—such as drilling, sorting, and selecting. When you take the analytic actions described in this topic, the filters are automatically applied for you.

Here are some of the analytic actions that you can take when you right-click content in visualizations:

- Use Sort to sort attributes in a visualization, such as product names from A to Z.

- Use Drill to drill to a data element, and you can drill through hierarchies in data elements, such as drilling to weeks within a quarter. You can also drill asymmetrically using multiple data elements. For example, you can select two separate year members that are columns in a pivot table, and drill into those members to see the details.

- Use Drill to [Attribute Name] to directly drill to a specific attribute within a visualization.

- Use Keep Selected to keep only the selected members and remove all others from the visualization and its linked visualizations. For example, you can keep only the sales that are generated by a specific sales associate.

- Use Remove Selected to remove selected members from the visualization and its linked visualizations. For example, you can remove the Eastern and Western regions from the selection.

- Use Add Reference Line or Band to add a reference line to highlight an important fact depicted in the visualization, such as a minimum or maximum value. For example, you might add a reference line across the visualization at the height of the maximum Revenue amount. You also might add a reference band to more clearly depict where the minimum and maximum Revenue amounts fall on the Revenue axis.

Note:
To add a reference band to a visualization, right-click it and select Add Reference Line to display the Properties dialog. On the Analytics tab, in the Method field, toggle Line to Band.

About Composing Expressions

You can compose an expression to use in an expression filter or in a calculation. For both expression filters and calculations, you use the Expression Builder. Expressions that you create for expression filters must be boolean (that is, they must evaluate to true or false). Expressions that you create for calculations are not limited in this way.

Note:
While you compose expressions for both expression filters and calculations, the end result is different. A calculation becomes a new data element that you can add to your visualization. An expression filter, on the other hand, only appears in the filter bar and cannot be added as a data element to a visualization. An expression filter can be created from a calculation, but a calculation cannot be created from an expression filter. For more information, see Creating Calculated Data Elements and Building Expression Filters.

You can compose an expression in various ways:

- You can directly enter text and functions in the Expression Builder by typing.

- You can add data elements from the Data Elements pane (drag and drop, or double-click).

- You can add functions from the function panel (drag and drop, or double-click).

For more information about expression elements, see Expression Editor Reference.

Creating Calculated Data Elements

You can use the Add Calculation dialog to create a new data element—typically a measure—to add to your visualization. For example, you can create a new measure called Profit. This new data element might involve the Revenue and Discount Amount measures.

To add a calculation:

1. Launch the Add Calculation dialog in one of two ways:

- At the bottom of the Data Elements pane, click Add Calculation.

- In the Data Elements pane, right-click the My Calculations folder and select Add Calculation.

2. In the Expression Builder, compose an expression. See About Composing Expressions.
For example, to create the new measure called profit, compose this expression: "Sample Sales"."Base Facts"."Revenue"-"Sample Sales"."Base Facts"."Discount Amount".

3. Optionally, click Validate.

4. In the Display field, enter a data element name.

5. Click Save.
The new data element is created and you can use it in your visualizations as you would any other data element. For example, in visualization drop targets or in filters.

Specifying How Visualizations Interact with One Another

You can specify how visualizations interact with each other. Such interactions often involve master-detail relationships.

You use the Synchronize Visualizations setting to specify how the visualizations on your canvas interact. By default, visualizations are linked for automatic synchronization. You can turn off Synchronize Visualizations to unlink your visualizations for automatic synchronization.

- When Synchronize Visualizations is on (checked):

All filters and actions that produce filters (such as Drill, Keep Selected, Remove Selected) are applied to all visualizations on the canvas. For example, if you have a canvas with multiple visualizations and you drill in one of the visualizations, a corresponding filter is added to the filter bar and it affects all visualizations on the canvas.

- When Synchronize Visualizations is off (unchecked):

- The analytic actions such as Drill or Keep Selected affect only the visualization to which you applied the action. In this mode, the filters are displayed in a small filter bar above each visualization.

- There is an additional option, Use as Master, that is available from all visualizations’ context menu. If Use as Master is turned on for a given visualization, then that one becomes the master visualization for the canvas. This means that selecting data in the master applies a filter to all other visualizations on the canvas.

Note:
There can be zero or one master visualization per canvas.

When a visualization is set as the master, a circled blue M displays before its name.

3 Adding Your Own Data

This topic describes how to add your own data for analysis and exploration.

Topics:

- Typical Workflow for Adding Data from External Sources

- About Adding Your Own Data

- About Characteristics for External Sources

- Adding Data from External Sources

- Blending Data that You Added

- Refreshing Data that You Added

- Updating Details of Data You Added

- Controlling Sharing of Data You Added

- Removing Data that You Added

- Deleting Data that You Added

- Managing Data Files

Typical Workflow for Adding Data from External Sources

Here are the common tasks for adding data from external sources.

Task

Description

More Information

Add data

Add data from external sources.

Adding Data from External Sources

Blend data

Blend data from external sources with an existing subject area.

Blending Data that You Added

Refresh data

Refresh data when you know the external source was updated.

Refreshing Data that You Added

Control sharing of external sources

Specify which users can access the data that you added.

Controlling Sharing of Data You Added

Remove data

Remove data that you added.

Removing Data that You Added

About Adding Your Own Data

It’s easy to add data from external sources. Adding your own data is sometimes referred to as “mash-up.”

You can add data in these ways:

- Add your own data to analyze on its own.
You can create a project that is based solely on data from an external source without adding that data to an existing data model in Visual Analyzer.

- Add your own data as an extension to an existing subject area.
You can load data to Visual Analyzer from an external source that is related to an existing Subject Area. You may need to identify the columns that have common values so that Visual Analyzer can match external and Subject Area rows appropriately. You can "Add Facts" where a table includes measures - columns that are typically summed or averaged, or you can "Extend Dimensions" where a table includes no measures.

Note:
You can match multiple external sources to a subject area, but you can’t match an external source to another external source.

Suppose that you have a subject area that contains data about sales, such as Products, Brands, and Salespeople. You have a spreadsheet file that contains Target Revenue sales figures, which do not exist in the subject area. You’d like to create a visualization that combines Product and Brand values from the subject area with the Target Revenue figures from your spreadsheet. When you add the data, you match the Product and Brand columns from the spreadsheet with those in the subject area and add Target Revenue as a measure. The matching connects the spreadsheet with the subject area. When you drag the three columns to the canvas, Visual Analyzer treats the data as if it is part of one integrated system.

When you add data to projects, it uses the names and data types of the columns being added to guess the best way to blend the data for you. You can make manual adjustments if that guess is not appropriate. Data modeling is implied rather than explicit. The system does the work for you, but you can make manual adjustments if you want to. For more information, see Blending Data that You Added.

When you blend external data files, the columns that you introduce behave as though they are part of the data model, even though you have not made any changes in Oracle Business Intelligence. The data that you add is saved by name in Oracle Business Intelligence. You can add the data to projects and share it with other users. You can delete the data when you need to preserve space. For more information, see Deleting Data that You Added.

About Characteristics for External Sources

A data source that you add must have certain characteristics.

The data must be from a Microsoft Excel spreadsheet file, with the XLSX extension (signifying a Microsoft Office Open XML Workbook file) and a maximum size of 50 MB.

Note:
Before you can upload a Microsoft Excel file as a data source, it must be structured in a data oriented way. This includes avoiding null values in dimension attributes and deleting aggregate rows. Also, ensure that all values for a dimension are placed in a single column. For example, don’t include a column for January, another for February, and so on.

A data source either extends a dimension by adding attributes or extends facts by adding measures and optional attributes. Hierarchies cannot be defined in external data sources.

Various criteria apply to sources that extend a dimension by adding attributes:

- Matches can be made only to a single dimension.

- The set of values in matched columns must be unique in the external data source. For example, if the data source matches on zip code, then zip codes in the external source must be unique.

- Matches can be between one or composite columns. An example of a one-column match is that “product key” matches “product key”. For composite columns, an example is that “company” matches “company” and “business unit” matches “business unit”.

- All other columns must be attributes.

Various criteria apply to sources that add measures:

- Matches can be made to one or more dimensions.

- The set of values in matched columns does not need to be unique in the external data source. For example, if the data source is a set of sales matched to date, customer, and product, then you can have multiple sales of a product to a customer on the same day.

- Matches can be between one or composite columns. An example of a one-column match is that “product key” matches “product key”. For composite columns, an example is that “company” matches “company” and “business unit” matches “business unit”.

- The data source that adds measures can include attributes. You can use these attributes only alongside the external measures and not alongside the curated measures in visualizations. For example, when you add a source with the sales figures for a new business, you can match these new business sales to an existing time dimension and nothing else. The external data might include information about the products sold by this new business. You can show the sales for the existing business with those of the new business by time, but you can’t show the old business revenue by new business products, nor new business revenue by old business products. You can show new business revenue by time and new business products.

When you save a project or an analysis, the permissions are synchronized between the project or analysis and the external sources that it uses. If you share the project or analysis with other users, then the external sources are also shared with those same users.

Be aware of the effect of mixing columns that don’t match from data sources with a subject area. For example, suppose that you have a subject area that includes a Product attribute and an Orders attribute. You create a pivot table that includes those two attributes with a Revenue measure from a data source. The data source that includes the Revenue measure includes a Product column that matches the Product attribute in the subject area, but the data sources does not include an Orders columns. No Revenue data is shown in the pivot table for the Orders attribute.

Adding Data from External Sources

You can introduce your own external sources directly into a production reporting environment without changing the data model. Visual Analyzer automatically conforms the external data to the curated enterprise data.

You can add data to blend with an existing subject area or create a new project without a subject area that includes data from an external source. A project can contain one subject area with one or more external subject areas, or a project can contain one external subject area. Subject areas and external subject areas have separate, distinct icons in the Data Sources pane to help you identify them. For more information, see About Characteristics for External Sources.

To add data from an external source:

1. In Visual Analyzer, open or create a project.

2. Right-click the Data Sources pane, and select Add Data Source.

You can also click the Add Data Source link at the bottom of the Data Sources pane or right-click anywhere in the pane to display the Add Data Source option.

3. In the Add Source dialog, select either the Data Files tab (if the file is in saved storage) or click Upload File (if the file is stored locally).

Note:
When you select to add a saved file and already have a subject area for the project, you see a list of those saved files that are already connected by default. You can select and add a source that is not connected.

4. Select the appropriate file and click Add to Project to display the Add Source dialog.
If you selected a saved file on the Data Files tab, then the external data source is added to the project and you can skip the remaining steps.

5. In the Upload File dialog, click Select File to select a locally stored file.

6. If the file contains multiple sheets, select the sheet with the data you want to load.

7. When uploading a source for the first time, edit the source names and descriptions to be more meaningful to you.

8. Preview a sample of the data. Visual Analyzer automatically matches columns in the external source with the appropriate items in the data model. Note how columns will be added as measures, as attributes, or matched with an existing column in the subject area.

9. To exclude a column, hover over the column name and click the check mark.

Note:
A column that is unavailable and marked with a red information symbol is invalid and will be excluded. You can hover over the symbol to learn the reason why the column is invalid. Typically this happens because the column name contains illegal characters (leading, trailing spaces, special chars) or the column name is a duplicate.

10. Click Add to Project to accept the data associations. See Blending Data that You Added for details on manually editing data associations.

The data model expands to include the data from the source that you added.

Note:
You can load a new data set independently of an existing subject area, which means that you can analyze almost any data in Visual Analyzer. From the project toolbar, click New Project. In the Add Source dialog, select an existing file from saved storage or upload the file from a local disk.

Blending Data that You Added

You might have a project that includes data from a subject area that enhances that subject area. You can blend the data from the external source with the subject area after adding the data to the project.

For example, the external source might contain new dimensions that extend the attributes of the subject area or new facts that you can use alongside the measures that already exist in the subject area. When you add data from external sources, the system tries to find matches for the data that is added. It automatically matches external dimensions where they share a common name and have a compatible data type with attributes in the subject area. You can also fine-tune the blending of the data from the external source into the subject area.

To blend data that you added:

1. Add data as described in Adding Data from External Sources.

2. In the Data Sources pane, click Source Diagram.

3. Click the number along the line that connects the external source to the subject area to display the Connect Sources dialog.

Note:
Items that were never explicitly matched together may be matched by the system. For example, Customer.Person_Name is matched to Employee.Name, and Employee.Name is matched to Spouse.Given_Name. The diagram shows a match between Customer.Person_Name and Spouse.Given_Name. It means that Customer and Spouse can be used in another project without having Employee present.

4. In the Connect Sources dialog, make changes as necessary.

a. To change the match for a column, click the name of each column to select a different column from the external data source from the subject area.

Note:
If columns have the same name and same data type, then they are recognized as a possible match. You can customize this and specify that one column matches another by explicitly selecting it even its name is not the same. You can select only those columns with a matching data type.

b. Click Add Another Match, and then select a column from the external source and from the subject area to match.

c. For a measure that you are uploading for the first time, specify the aggregation type such as Sum or Average.
See Specifying Aggregation for Measures in Fact Tables for descriptions of aggregation types.

d. Click the X to delete a match.

5. Click OK to save the matches from the external source to the data model on the server.

Refreshing Data that You Added

After you add data, you might need to refresh the data from its source if you learn that it has changed.

To refresh data that you previously added, you must ensure that the newer spreadsheet file contains a sheet with the same name as the original one. In addition, the sheet must contain the same columns that are already matched with the subject area.

You can completely replace data that you previously added, if you add new data to the data source and rename that data source with the same name as the existing one. You are prompted to verify that you want to overwrite the existing data and it doesn’t matter whether the sheet name or columns match.

To refresh data that you added:

1. In the Data Sources pane, or the Subject Areas pane, right-click the data that you want to refresh.

2. Select Reload Data.

3. In the dialog, select the source that contains the newer data and click Open.

4. Review the data to refresh and click OK.

The original data is overwritten with new data, which is displayed in visualizations in the project or analysis, once the visualization is refreshed.

Updating Details of Data You Added

After adding data, you can inspect its properties and update details such as its description and aggregation.

1. In the Data Sources pane, right-click the data and then select Inspect.

2. Inspect the properties and update the description of the data as appropriate.

3. In the Columns area, specify whether to change a column to a measure or attribute as appropriate. For measures, specify the aggregation type, such as Sum or Average.
See Specifying Aggregation for Measures in Fact Tables for descriptions of aggregation types.

4. To specify if others can share the data, see Controlling Sharing of Data You Added.

5. Click OK to save your changes to the data model.

Controlling Sharing of Data You Added

After you add data, the data is visible only to you as the user who uploaded and owns it. You as the owner or other users with appropriate permissions can specify the data as a shared resource that other users who have access to the server environment can include immediately in projects. You control which users can share the external data.

To control sharing of external data:

1. In the Data Sources pane, right-click the external data source, and select Inspect.

2. In the Permissions tab, double-click a user or role to grant access.
Select the appropriate level of access: Full Control, Modify, Read, or No Access.

3. In the Permissions tab, click the X beside a user or role to remove it from the selection of permissions that you are managing.

Removing Data that You Added

You can remove data that you have added from an external source.

If you remove data, it is removed from the project or analysis. Removing data differs from deleting data, as described in Deleting Data that You Added.
To remove data that you added:

1. In the Data Sources pane in Visual Analyzer or the Subject Areas pane of Oracle Business Intelligence, right-click the data that you want to remove.

2. Select Remove from Project or Remove from Analysis to remove data from the data sources list.

Deleting Data that You Added

You can delete data that you have added, when you need to free up space

Deleting permanently removes the external source. You can only delete external sources. You cannot delete subject areas that you have included in projects or analyses.

Deleting data differs from removing data, as described in Removing Data that You Added.

To delete data that you added:

1. In the Data Sources pane in Visual Analyzer or the Subject Areas pane of Oracle Business Intelligence, right-click the data that you want to remove.

2. Select Delete to erase the data from storage.

Note:
You can also delete external data sources from the Data Sources page. For more information, see Managing Data Files.

Managing Data Files

You can view, and delete file-based sources for projects and analyses. You can use the Data Sources page to view properties and columns in data files, change column properties such as the aggregation type, set the permissions for uploaded data sources, and delete data files that are no longer needed. This page also shows you an indicator at the bottom of the page to help you keep track of your data set quota.

To view and manage data files:

1. On the Home page, click Data Sources.

2. On the Data Sources page, click a data file to select it.

3. Click Actions, and then select Inspect.

4. Review the columns in the data file. On the Data Source dialog Overview tab, you can change the data file description and column properties. For example, for the Product Number column, you can change the Aggregation type to Minimum.

5. Optionally, change whether to treat the columns as measures or attributes. You can't change how a column is treated if it is matched to a measure or attribute in your data model. For more information on removing matches, see Blending Data That You Added.

6. Click OK.

Note:
If you have Full Control permissions, you can grant permissions to others and delete the data file. But be careful not to delete a data file that is still a data source for reports. See Deleting Data that You Added.

A Expression Editor Reference

This topic describes the expression elements that you can use in the Expression Editor.

Topics:

- SQL Operators

- Conditional Expressions

- Functions

- Constants

- Types

SQL Operators

SQL operators are used to specify comparisons between expressions.

You can use various types of SQL operators.

Operator

Description

BETWEEN

Determines if a value is between two non-inclusive bounds. For example:

"COSTS"."UNIT_COST" BETWEEN 100.0 AND 5000.0

BETWEEN can be preceded with NOT to negate the condition.

IN

Determines if a value is present in a set of values. For example:

"COSTS"."UNIT_COST" IN(200, 600, 'A')

IS NULL

Determines if a value is null. For example:

"PRODUCTS"."PROD_NAME" IS NULL

LIKE

Determines if a value matches all or part of a string. Often used with wildcard characters to indicate any character string match of zero or more characters (%) or any single character match (_). For example:

"PRODUCTS"."PROD_NAME" LIKE 'prod%'

Conditional Expressions

You use conditional expressions to create expressions that convert values.

The conditional expressions described in this section are building blocks for creating expressions that convert a value from one form to another.

Note:

- In CASE statements, AND has precedence over OR

- Strings must be in single quotes

Expression

Example

Description

CASE (If)

CASE

WHEN score-par < 0 THEN 'Under Par'

WHEN score-par = 0 THEN 'Par'

WHEN score-par = 1 THEN 'Bogey'

WHEN score-par = 2 THEN 'Double Bogey'

ELSE 'Triple Bogey or Worse'

END

Evaluates each WHEN condition and if satisfied, assigns the value in the corresponding THEN expression.

If none of the WHEN conditions are satisfied, it assigns the default value specified in the ELSE expression. If no ELSE expression is specified, the system automatically adds an ELSE NULL.

CASE (Switch)

CASE Score-par

WHEN -5 THEN 'Birdie on Par 6'

WHEN -4 THEN 'Must be Tiger'

WHEN -3 THEN 'Three under par'

WHEN -2 THEN 'Two under par'

WHEN -1 THEN 'Birdie'

WHEN 0 THEN 'Par'

WHEN 1 THEN 'Bogey'

WHEN 2 THEN 'Double Bogey'

ELSE 'Triple Bogey or Worse'

END

Also referred to as CASE (Lookup). The value of the first expression is examined, then the WHEN expressions. If the first expression matches any WHEN expression, it assigns the value in the corresponding THEN expression.

If none of the WHEN expressions match, it assigns the default value specified in the ELSE expression. If no ELSE expression is specified, the system automatically adds an ELSE NULL.

If the first expression matches an expression in multiple WHEN clauses, only the expression following the first match is assigned.

Functions

There are various types of functions that you can use in expressions.

Topics:

- Aggregate Functions

- Calendar Functions

- Conversion Functions

- Display Functions

- Evaluate Functions

- Mathematical Functions

- String Functions

- System Functions

- Time Series Functions

Aggregate Functions

Aggregate functions perform operations on multiple values to create summary results.

Function

Example

Description

Avg

Avg(Sales)

Calculates the average (mean) of a numeric set of values.

Bin

Bin(UnitPrice BY ProductName)

Places any numeric attribute from a dimension, fact table, or measure containing data values and places them into a discrete number of bins. This function is treated like a new dimension attribute for purposes such as aggregation, filtering, and drilling.

Count

Count(Products)

Determines the number of items with a non-null value.

First

First(Sales)

Selects the first non-null returned value of the expression argument. The First function operates at the most detailed level specified in your explicitly defined dimension.

Last

Last(Sales)

Selects the last non-null returned value of the expression.

Max

Max(Revenue)

Calculates the maximum value (highest numeric value) of the rows satisfying the numeric expression argument.

Median

Median(Sales)

Calculates the median (middle) value of the rows satisfying the numeric expression argument. When there are an even number of rows, the median is the mean of the two middle rows. This function always returns a double.

Min

Min(Revenue)

Calculates the minimum value (lowest numeric value) of the rows satisfying the numeric expression argument.

StdDev

StdDev(Sales) StdDev(DISTINCT Sales)

Returns the standard deviation for a set of values. The return type is always a double.

StdDev_Pop

StdDev_Pop(Sales) StdDev_Pop(DISTINCT Sales)

Returns the standard deviation for a set of values using the computational formula for population variance and standard deviation.

Sum

Sum(Revenue)

Calculates the sum obtained by adding up all values satisfying the numeric expression argument.

Calendar Functions

Calendar functions manipulate data of the data types DATE and DATETIME based on a calendar year.

Function

Example

Description

Current_Date

Current_Date

Returns the current date.

Current_Time

Current_Time(3)

Returns the current time to the specified number of digits of precision, for example: HH:MM:SS.SSS

If no argument is specified, the function returns the default precision.

Current_TimeStamp

Current_TimeStamp(3)

Returns the current date/timestamp to the specified number of digits of precision.

DayName

DayName(Order_Date)

Returns the name of the day of the week for a specified date expression.

DayOfMonth

DayOfMonth(Order_Date)

Returns the number corresponding to the day of the month for a specified date expression.

DayOfWeek

DayOfWeek(Order_Date)

Returns a number between 1 and 7 corresponding to the day of the week for a specified date expression. For example, 1 always corresponds to Sunday, 2 corresponds to Monday, and so on through to Saturday which returns 7.

DayOfYear

DayOfYear(Order_Date)

Returns the number (between 1 and 366) corresponding to the day of the year for a specified date expression.

Day_Of_Quarter

Day_Of_Quarter(Order_Date)

Returns a number (between 1 and 92) corresponding to the day of the quarter for the specified date expression.

Hour

Hour(Order_Time)

Returns a number (between 0 and 23) corresponding to the hour for a specified time expression. For example, 0 corresponds to 12 a.m. and 23 corresponds to 11 p.m.

Minute

Minute(Order_Time)

Returns a number (between 0 and 59) corresponding to the minute for a specified time expression.

Month

Month(Order_Time)

Returns the number (between 1 and 12) corresponding to the month for a specified date expression.

MonthName

MonthName(Order_Time)

Returns the name of the month for a specified date expression.

Month_Of_Quarter

Month_Of_Quarter(Order_Date)

Returns the number (between 1 and 3) corresponding to the month in the quarter for a specified date expression.

Now

Now()

Returns the current timestamp. The Now function is equivalent to the Current_Timestamp function.

Quater_Of_Year

Quarter_Of_Year(Order_Date)

Returns the number (between 1 and 4) corresponding to the quarter of the year for a specified date expression.

Second

Second(Order_Time)

Returns the number (between 0 and 59) corresponding to the seconds for a specified time expression.

TimeStampAdd

TimeStampAdd(SQL_TSI_MONTH, 12,Time."Order Date")

Adds a specified number of intervals to a timestamp, and returns a single timestamp.

Interval options are: SQL_TSI_SECOND, SQL_TSI_MINUTE, SQL_TSI_HOUR, SQL_TSI_DAY, SQL_TSI_WEEK, SQL_TSI_MONTH, SQL_TSI_QUARTER, SQL_TSI_YEAR

TimeStampDiff

TimeStampDiff(SQL_TSI_MONTH, Time."Order Date",CURRENT_DATE)

Returns the total number of specified intervals between two timestamps.

Use the same intervals as TimeStampAdd.

Week_Of_Quarter

Week_Of_Quarter(Order_Date)

Returns a number (between 1 and 13) corresponding to the week of the quarter for the specified date expression.

Week_Of_Year

Week_Of_Year(Order_Date)

Returns a number (between 1 and 53) corresponding to the week of the year for the specified date expression.

Year

Year(Order_Date)

Returns the year for the specified date expression.

Conversion Functions

Conversion functions convert a value from one form to another.

Function

Example

Description

Cast

Cast(hiredate AS CHAR(40)) FROM employee

Changes the data type of an expression or a null literal to another data type. For example, you can cast a customer_name (a data type of Char or Varchar) or birthdate (a datetime literal).

Use Cast to change to a Date data type. Do not use ToDate.

IfNull

IfNull(Sales, 0)

Tests if an expression evaluates to a null value, and if it does, assigns the specified value to the expression.

IndexCol

SELECT IndexCol(VALUEOF (NQ_SESSION.GEOGRAPHY_LEVEL), Country, State, City), Revenue FROM Sales

Uses external information to return the appropriate column for the signed-in user to see.

NullIf

SELECT e.last_name, NULLIF(e.job_id, j.job_id) "Old Job ID" FROM employees e, job_history j WHERE e.employee_id = j.employee_id ORDER BY last_name, "Old Job ID";

Compares two expressions. If they are equal, then the function returns null. If they are not equal, then the function returns the first expression. You cannot specify the literal NULL for the first expression.

To_DateTime

SELECT To_DateTime ('2009-03-0301:01:00', 'yyyy-mm-dd hh:mi:ss') FROM sales

Converts string literals of dateTime format to a DateTime data type.

Display Functions

Display functions operate on the result set of a query.

Function

Example

Description

BottomN

BottomN(Sales, 10)

Returns the n lowest values of expression, ranked from lowest to highest.

Filter

Filter(Sales USING Product = 'widgit')

Computes the expression using the given preaggregate filter.

Mavg

Mavg(Sales, 10)

Calculates a moving average (mean) for the last n rows of data in the result set, inclusive of the current row.

Msum

SELECT Month, Revenue, Msum(Revenue, 3) as 3_MO_SUM FROM Sales

Calculates a moving sum for the last n rows of data, inclusive of the current row.

The sum for the first row is equal to the numeric expression for the first row. The sum for the second row is calculated by taking the sum of the first two rows of data, and so on. When the nth row is reached, the sum is calculated based on the last n rows of data.

NTile

Ntile(Sales, 100)

Determines the rank of a value in terms of a user-specified range. It returns integers to represent any range of ranks. The example shows a range from 1 to 100, with the lowest sale = 1 and the highest sale = 100.

Percentile

Percentile(Sales)

Calculates a percent rank for each value satisfying the numeric expression argument. The percentile rank ranges are from 0 (1st percentile) to 1 (100th percentile), inclusive.

Rank

Rank(Sales)

Calculates the rank for each value satisfying the numeric expression argument. The highest number is assigned a rank of 1, and each successive rank is assigned the next consecutive integer (2, 3, 4,...). If certain values are equal, they are assigned the same rank (for example, 1, 1, 1, 4, 5, 5, 7...).

Rcount

SELECT month, profit, Rcount(profit) FROM sales WHERE profit > 200

Takes a set of records as input and counts the number of records encountered so far.

Rmax

SELECT month, profit, Rmax(profit) FROM sales

Takes a set of records as input and shows the maximum value based on records encountered so far. The specified data type must be one that can be ordered.

Rmin

SELECT month, profit, Rmin(profit) FROM sales

Takes a set of records as input and shows the minimum value based on records encountered so far. The specified data type must be one that can be ordered.

Rsum

SELECT month, revenue, Rsum(revenue) as RUNNING_SUM FROM sales

Calculates a running sum based on records encountered so far.

The sum for the first row is equal to the numeric expression for the first row. The sum for the second row is calculated by taking the sum of the first two rows of data, and so on.

TopN

TopN(Sales, 10)

Returns the n highest values of expression, ranked from highest to lowest.

Evaluate Functions

Evaluate functions are database functions that can be used to pass through expressions to get advanced calculations.

Embedded database functions can require one or more columns. These columns are referenced by %1 ... %N within the function. The actual columns must be listed after the function.

Function

Example

Description

Evaluate

SELECT EVALUATE('instr(%1, %2)', address, 'Foster City') FROM employees

Passes the specified database function with optional referenced columns as parameters to the database for evaluation.

Evaluate_Aggr

EVALUATE_AGGR('REGR_SLOPE(%1, %2)', sales.quantity, market.marketkey)

Passes the specified database function with optional referenced columns as parameters to the database for evaluation. This function is intended for aggregate functions with a GROUP BY clause.

Mathematical Functions

The mathematical functions described in this section perform mathematical operations.

Function

Example

Description

Abs

Abs(Profit)

Calculates the absolute value of a numeric expression.

Acos

Acos(1)

Calculates the arc cosine of a numeric expression.

Asin

Asin(1)

Calculates the arc sine of a numeric expression.

Atan

Atan(1)

Calculates the arc tangent of a numeric expression.

Atan2

Atan2(1, 2)

Calculates the arc tangent of y/x, where y is the first numeric expression and x is the second numeric expression.

Ceiling

Ceiling(Profit)

Rounds a noninteger numeric expression to the next highest integer. If the numeric expression evaluates to an integer, the CEILING function returns that integer.

Cos

Cos(1)

Calculates the cosine of a numeric expression.

Cot

Cot(1)

Calculates the cotangent of a numeric expression.

Degrees

Degrees(1)

Converts an expression from radians to degrees.

Exp

Exp(4)

Sends the value to the power specified.

ExtractBit

Int ExtractBit(1, 5)

Retrieves a bit at a particular position in an integer. It returns an integer of either 0 or 1 corresponding to the position of the bit.

Floor

Floor(Profit)

Rounds a noninteger numeric expression to the next lowest integer. If the numeric expression evaluates to an integer, the FLOOR function returns that integer.

Log

Log(1)

Calculates the natural logarithm of an expression.

Log10

Log10(1)

Calculates the base 10 logarithm of an expression.

Mod

Mod(10, 3)

Divides the first numeric expression by the second numeric expression and returns the remainder portion of the quotient.

Pi

Pi()

Returns the constant value of pi.

Power

Power(Profit, 2)

Takes the first numeric expression and raises it to the power specified in the second numeric expression.

Radians

Radians(30)

Converts an expression from degrees to radians.

Rand

Rand()

Returns a pseudo-random number between 0 and 1.

RandFromSeed

Rand(2)

Returns a pseudo-random number based on a seed value. For a given seed value, the same set of random numbers are generated.

Round

Round(2.166000, 2)

Rounds a numeric expression to n digits of precision.

Sign

Sign(Profit)

This function returns the following:

- 1 if the numeric expression evaluates to a positive number

- -1 if the numeric expression evaluates to a negative number

- 0 if the numeric expression evaluates to zero

Sin

Sin(1)

Calculates the sine of a numeric expression.

Sqrt

Sqrt(7)

Calculates the square root of the numeric expression argument. The numeric expression must evaluate to a nonnegative number.

Tan

Tan(1)

Calculates the tangent of a numeric expression.

Truncate

Truncate(45.12345, 2)

Truncates a decimal number to return a specified number of places from the decimal point.

String Functions

String functions perform various character manipulations. They operate on character strings.

Function

Example

Description

Ascii

Ascii('a')

Converts a single character string to its corresponding ASCII code, between 0 and 255. If the character expression evaluates to multiple characters, the ASCII code corresponding to the first character in the expression is returned.

Bit_Length

Bit_Length('abcdef')

Returns the length, in bits, of a specified string. Each Unicode character is 2 bytes in length (equal to 16 bits).

Char

Char(35)

Converts a numeric value between 0 and 255 to the character value corresponding to the ASCII code.

Char_Length

Char_Length(Customer_Name)

Returns the length, in number of characters, of a specified string. Leading and trailing blanks are not counted in the length of the string.

Concat

SELECT DISTINCT Concat ('abc', 'def') FROM employee

Concatenates two character strings.

Insert

SELECT Insert('123456', 2, 3, 'abcd') FROM table

Inserts a specified character string into a specified location in another character string.

Left

SELECT Left('123456', 3) FROM table

Returns a specified number of characters from the left of a string.

Length

Length(Customer_Name)

Returns the length, in number of characters, of a specified string. The length is returned excluding any trailing blank characters.

Locate

Locate('d' 'abcdef')

Returns the numeric position of a character string in another character string. If the character string is not found in the string being searched, the function returns a value of 0.

LocateN

Locate('d' 'abcdef', 3)

Like Locate, returns the numeric position of a character string in another character string. LocateN includes an integer argument that enables you to specify a starting position to begin the search.

Lower

Lower(Customer_Name)

Converts a character string to lowercase.

Octet_Length

Octet_Length('abcdef')

Returns the number of bytes of a specified string.

Position

Position('d', 'abcdef')

Returns the numeric position of strExpr1 in a character expression. If strExpr1 is not found, the function returns 0.

Repeat

Repeat('abc', 4)

Repeats a specified expression n times.

Replace

Replace('abcd1234', '123', 'zz')

Replaces one or more characters from a specified character expression with one or more other characters.

Right

SELECT Right('123456', 3) FROM table

Returns a specified number of characters from the right of a string.

Space

Space(2)

Inserts blank spaces.

Substring

Substring('abcdef' FROM 2)

Creates a new string starting from a fixed number of characters into the original string.

SubstringN

Substring('abcdef' FROM 2 FOR 3)

Like Substring, creates a new string starting from a fixed number of characters into the original string.

SubstringN includes an integer argument that enables you to specify the length of the new string, in number of characters.

TrimBoth

Trim(BOTH '_' FROM '_abcdef_')

Strips specified leading and trailing characters from a character string.

TrimLeading

Trim(LEADING '_' FROM '_abcdef')

Strips specified leading characters from a character string.

TrimTrailing

Trim(TRAILING '_' FROM 'abcdef_')

Strips specified trailing characters from a character string.

Upper

Upper(Customer_Name)

Converts a character string to uppercase.

System Functions

The USER system function returns values relating to the session.

It returns the user name you signed in with.

Time Series Functions

Time series functions are aggregate functions that operate on time dimensions.

The time dimension members must be at or below the level of the function. Because of this, one or more columns that uniquely identify members at or below the given level must be projected in the query.

Function

Example

Description

Ago

SELECT Year_ID, Ago(sales, year, 1)

Calculates the aggregated value of a measure from the current time to a specified time period in the past. For example, AGO can produce sales for every month of the current quarter and the corresponding quarter-ago sales.

Periodrolling

SELECT Month_ID, Periodrolling (monthly_sales, -1, 1)

Computes the aggregate of a measure over the period starting x units of time and ending y units of time from the current time. For example, PERIODROLLING can compute sales for a period that starts at a quarter before and ends at a quarter after the current quarter.

ToDate

SELECT Year_ID, Month_ID, ToDate (sales, year)

Aggregates a measure from the beginning of a specified time period to the currently displayed time. For example, this function can calculate Year to Date sales.

Constants

You can use constants in expressions.

Available constants include Date, Time, and Timestamp.

Constant

Example

Description

Date

DATE [2014-04-09]

Inserts a specific date.

Time

TIME [12:00:00]

Inserts a specific time.

TimeStamp

TIMESTAMP [2014-04-09 12:00:00]

Inserts a specific timestamp.

Types

You can use data types, such as CHAR, INT, and NUMERIC in expressions.

For example, you use types when creating CAST expressions that change the data type of an expression or a null literal to another data type.

Oracle Legal Notices

Copyright Notice

Copyright © 1994-2015, Oracle and/or its affiliates. All rights reserved.

Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

License Restrictions Warranty/Consequential Damages Disclaimer

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

Warranty Disclaimer

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

Restricted Rights Notice

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

Hazardous Applications Notice

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Third-Party Content, Products, and Services Disclaimer

This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

Alpha and Beta Draft Documentation Notice

If this document is in preproduction status:

This documentation is in preproduction status and is intended for demonstration and preliminary use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of this documentation.