Skip Navigation
Using report variables in Analytics
Answer ID 2689   |   Last Review Date 03/18/2019

What are report variables and how do they work?


Variables used in Analytics
Oracle B2C Service


Variables can be used in report output columns and data exceptions.  Using a variable in an output column allows different data to be returned or data in different formats in the same column.  For example, a single report can be created that displays the number of incidents by a staff member, group, queue, or status.  One of these four values can be used as a variable in the report and can be selected from the Search window or from a menu at the top of the report if the variable is docked.

For example, the following variable can be used to group data together based on a specific time interval:

date_group(incidents.created, $date_grp_param)

When using the above variable, a "Date Grouping" menu listing various units of time will appear in the report's Search window, so the report can be run showing different date groupings per the date range selected (e.g. Year/Month/Day, Year/Week, etc.).  Please note that you need to have some type of date range filter using the same date field in place for this variable to work properly; for example, "incidents.created BETWEEN -1 Weeks to 0 Weeks".

Using a variable in a data exception allows a single exception to flag different data.  This eliminates the need to create multiple exceptions to flag data in different columns.  For example, a variable could be used in an exception to flag incidents that were created more than one day ago, or to flag incidents that were updated more than one day ago.  The information you want to flag is selected on the Search window when the report is generated.

Before variables can be used in output columns or data exceptions, the variables first need to be created.  There are several types of variables that can be used, including pre-defined lists, user-defined lists, ad-hoc values, and replacement values.  Each of these serves a unique function.

Once a variable is created in a report, it is added to the variables list in the report design center's data dictionary.  Output columns can be created that use the variable in the same fashion as any other output column, creating the column's expression from database fields, functions, computed fields, and variables listed in the data dictionary.  In some cases, the variable will be the only item in the column's expression.  In other cases, the variable will be combined with functions or database fields to form the column's expression.

When a pre-defined list, user-defined list, or ad-hoc variable is included in a report's output columns, a menu listing the variable's options will display on the report's Search window.  The variable menu can also display at the top of the report in the docked filters section for easy access by individuals using the report.

For additional examples and information regarding variables, refer to the 'Variables' section in online documentation for the version your site is currently running.  To access Oracle B2C Service manuals and documentation online, refer to the Documentation for Oracle B2C Service Products.

Available Languages for this Answer:

Notify Me
The page will refresh upon submission. Any pending input will be lost.