You are on page 1of 13

ORACLE SALES CLOUD IMPLEMENTATION NOTE

ORACLES SALES CLOUD BUSINESS INTELLIGENCE VARIABLES

August 3, 2016
CONTENTS

Overview ................................................................................................................................................ 4

Variable Types ........................................................................................................................................ 5

Session Variables ................................................................................................................................ 5

Repository Variables .......................................................................................................................... 6

Presentation Variable ......................................................................................................................... 7

Request Variable ................................................................................................................................ 8

Sample Reports ...................................................................................................................................... 9

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 2 of 13
SAFE HARBOR

The following is intended to outline our general product direction. It is intended for information
purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any
material, code, or functionality, and should not be relied upon in making purchasing decisions. The
development, release, and timing of any features or functionality described for Oracles products
remains at the sole discretion of Oracle.

ABOUT THIS DOCUMENT

This document supplements standard product documentation, which you are encouraged to review. To
find documentation and other learning resources, such as guides, whitepapers, and videos, visit the
Help Center for Oracle Sales Cloud.

AUDIENCE

This document is for Oracle Sales Cloud customers involved in implementation. The tips and techniques
detailed in this document may not be suitable for an on-premise deployment of Oracle Sales Cloud
Applications. This document assumes that you know how to develop reports for Oracle Sales Cloud.

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 3 of 13
OVERVIEW

Oracle Sales Cloud Business Intelligence (BI) variables hold predefined values and can be referenced in multiple
areas during the runtime of reports and dashboards. For example, variables can be used to pre-filter or
dynamically filter the reports during runtime. Variables can be referenced in:

Report Views
Title View
Narrative View
Static Text
Chart Scale Markers
Gauge range settings
Column Filters
Column Formulas
Conditional Formatting conditions (presentation variables only)
Direct Database Requests
Dashboard prompts
iBot Headlines and text

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 4 of 13
VARIABLE TYPES

There are four different types of variables, based on how they are initialized:
1. Session Variables (pre-defined)
2. Repository Variables (pre-defined)
3. Presentation Variables (user definable)
4. Request Variables (user definable)

Later in this document, we give a few examples of how variables can be used. If you would like more details,
please refer to the Using Variables topic in the Oracle Fusion Middleware: User's Guide for Oracle Business
Intelligence Enterprise Edition.

SESSION VARIABLES

As the name suggests, session variables are created when a session begins, which is as soon as a user logs into the
BI server. Every login has its own session variable. There are two types of session variables, each of which can be
created only through the Oracle BI Administration Tool:

System which are defined by Oracle Business Intelligence Enterprise Edition (OBIEE) and are reserved
Non-System which are defined during the OBIEE Repository (RPD) development

Referencing session variables:

For displaying session variables: @{biServer.variables['NQ_SESSION.VariableName']}

For using session variables in expression: VALUEOF(NQ_SESSION.VariableName)

This table contains the list of session variables available when a user logs in.

Variable Name Description

USER_PARTY_ID Stores the PARTY_ID of the logged in user

FCST_TERR_LIST

FCST_TERR_HIER_LEVEL_LIST

HIER_LEVEL Returns the current Fixed Hierarchy level of the user in the
Company hierarchy. The company hierarchy is based on the
Employee hierarchy tree.

HIER_LEVEL_MANAGER

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 5 of 13
PREFERRED_CURRENCY

RESOURCE_HIER_LEVEL

RESOURCE_HIER_LEVEL_LIST

RESOURCE_ORG_HIER_LEVEL_LIST

RESOURCE_ORG_LIST

REVERSED_LTS_PRIORITY_SA_VEC

TERR_HIER_LEVEL_LIST

TERR_HIER_LEVEL_LIST_ALL

TERR_LIST

REPOSITORY VARIABLES

A repository variable is a variable that has a single value at any point in time. There are two types of repository
variables, each of which can be created only through Oracle BI Administration Tool:

Static changes only if an administrator or developer changes its value


Dynamic value is refreshed using a query

Referencing repository variables:

For display: @{biServer.variables.VariableName} or {biServer.variables['VariableName']}.

For using in expression: VALUEOF(VariableName)

This table contains the list of Repository variables available when a user logs in.

Variable Name Description

CURRENT_MONTH Returns the current calendar month.


CURRENT_WEEK Returns the current calendar week.
CURRENT_YEAR Returns the current calendar year.
CURRENT_CALENDAR_QTR Returns the current calendar quarter number in Q format.
CURRENT_CALENDAR_YEAR Returns the current calendar year in YYYY format.

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 6 of 13
Variable Name Description

CURRENT_DAY Returns the value of Current Date.


CURRENT_DAY_NUM Returns the value of Current Date in the YYYYMMDD format.
CURRENT_ENTERPRISE_PERIOD Returns the value of the Current Fiscal Period.
CURRENT_ENTERPRISE_QUARTER Returns the value of Current Enterprise Quarter in the YYYY Q n format.
CURRENT_ENTERPRISE_WEEK Returns the value of Current Enterprise Week in the YYYY Weeknn format.
CURRENT_ENTERPRISE_YEAR Returns the value of the Current Enterprise Year in the FYYYYY format.
CURRENT_MONTH Returns the value of Current Month in the YYYY/MM format.
CURRENT_QUARTER Returns the value of Current Fiscal Quarter in YYYY Q n format.
CURRENT_TRIMESTER Returns the value of the current trimester as a number.
CURRENT_WEEK Returns the value of the current week in YYYY Weeknnn format.
CURRENT_YEAR Returns the value of Current Year in the YYYY format.
ENTERPRISE_PERIOD_YEAR_AGO Returns the value of Previous Year Enterprise Period in YYYY/MM format.
ENTERPRISE_QTR_YEAR_AGO Returns the value of Previous Year Enterprise Quarter in YYYY Q n format.
NEXT_ENTERPRISE_PERIOD Returns the value of Next Enterprise Period.
NEXT_ENTERPRISE_QUARTER Returns the value of Next Enterprisel Quarter in the YYYY Q n.
NEXT_ENTERPRISE_WEEK Returns the value of Next Enterprise Week in the YYYY Weeknn format.
NEXT_ENTERPRISE_YEAR Returns the value of Next Enterprise Year in the FYYYYY format.
NEXT_MONTH Returns the value of Next Month in the YYYY / MM format.
NEXT_QUARTER Returns the value of Next Calendar Quarter in the YYYY Q nn format.
NEXT_WEEK Returns the value of Next Week in the YYYY Week nn format.
NEXT_YEAR Returns the value of Next Year in the YYYY format.
PREVIOUS_ENTERPRISE_PERIOD Returns the value of Previous Enterprise Period.
PREVIOUS_ENTERPRISE_QUARTER Returns the value of Previous Enterprise Quarter in the YYYY Q n format.
PREVIOUS_ENTERPRISE_WEEK Returns the value of Previous Enterprise Week in the YYYY Weeknn format.
PREVIOUS_ENTERPRISE_YEAR Returns the value of Previous Enterprise Year in the FYYYYY format.
PREVIOUS_MONTH Returns the value of Previous Month in the YYYY/MM format.
PREVIOUS_QUARTER Returns the value of Previous Fiscal Quarter in the YYYY Q nn format.
PREVIOUS_WEEK Returns the value of Previous Week in the YYYY Week nn format.
PREVIOUS_YEAR Returns the value of Previous Year in the YYYY format.
YEAR_AGO_DAY Returns the value of year ago date in the mm/dd/yyyy format.

PRESENTATION VARIABLES

A presentation variable can be created as a dashboard prompt. A dashboard prompt must be either a column
prompt or a variable prompt.
Column prompt: When a presentation variable is part of a column prompt, it is associated with a specific
column and initializes with that column's value.
Variable prompt: When a presentation variable is part of a variable prompt, the prompt values need to be
defined, as it is not associated with a column.

The name and value of the presentation variable are determined by the person that creates it. You need to use the
same name and value in your reference when you want to use the variable.

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 7 of 13
Referencing presentation variable:

For display: @{variables.VariableName}[Format]{DefaultValue} or @{scope.variables['VariableName']}.

Format is useful to format the data. For example, for a date, the format can be MM/DD/YYYY.

Note: Default Value is not formatted. Scope should be used if variables are created with the same name
and scope can be analyses, dashboard pages and dashboard.

For using in expression: @{VariableName}{DefaultValue}. Default value is optional.

REQUEST VARIABLES

Request Variable is used to overwrite the value of a session variable, which happens only during request initiation
to the database from a column prompt. When creating a column prompt, a request variable can defined.

Request variables can be referenced in the same way as presentation variables and can be seen in the logical SQL
from the Advanced tab in BI Answers.

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 8 of 13
SAMPLE REPORTS

SAMPLE LOGICAL SQL FOR SESSION AND REPOSITORY VARIABLES

SELECT

0 s_0,

VALUEOF("CURRENT_MONTH") s_1,

VALUEOF("CURRENT_WEEK") s_2,

VALUEOF(NQ_SESSION.USER) s_3,

VALUEOF(NQ_SESSION.USER_PARTY_ID) s_4

FROM "Sales - CRM Pipeline"

ORDER BY 1, 4 ASC NULLS LAST, 5 ASC NULLS LAST, 3 ASC NULLS LAST, 2 ASC NULLS LAST

FETCH FIRST 65001 ROWS ONLY

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 9 of 13
PRESENTATION VARIABLE IMPLEMENTATION

As stated earlier, the presentation variables can be set during runtime and can be used in filtering the reports or
overriding a request variable. This example gives a simple illustration of implementing a presentation variable in
Oracle Sales Cloud BI.

The scenario is that we want to filter period by Year, Month or Quarter. When a user selects a value from the
dashboard prompt, the data should be filtered, and the report should use those time values to present the data on
the dashboard. The steps to do this are:

1. Create a dashboard prompt with one prompt to select the time component (Year, Month or Quarter).
a. Select New > Dashboard Prompt. (Sales CRM - Pipeline subject area is used for this example.)
b. Select variable prompt and use the SQL given below to populate the values as shown in the screen
shot.

SELECT saw_0 FROM ((SELECT CASE WHEN 1=2 THEN "Sales - CRM Pipeline"."Time"."Enterprise Quarter"
ELSE 'Quarter' end saw_0 FROM "Sales - CRM Pipeline")
UNION
(SELECT CASE WHEN 1=2 THEN "Sales - CRM Pipeline"."Time"."Enterprise Year" ELSE 'Year' end saw_0
FROM "Sales - CRM Pipeline")
UNION
(SELECT CASE WHEN 1=2 THEN "Sales - CRM Pipeline"."Time"."Enterprise Period" ELSE 'Month' end saw_0
FROM "Sales - CRM Pipeline")) t1 ORDER BY saw_0

This variable value will be changed every time a user selects a value for this prompt and clicks Apply. This
value will be also used to populate the values for the next prompt.

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 10 of 13
2. Add the prompt on a dashboard. When you click the drop-down arrow, three values are visible as seen
below.

3. Create a new analysis or use an existing analysis, and add a Period column by changing the column
formula. Please refer to the logical SQL below.
SELECT
0 s_0,
"Sales - CRM Pipeline"."Opportunity"."Opportunity Status Category" s_1,
case when '' ='Quarter' then "Sales - CRM Pipeline"."Time"."Enterprise Quarter" when '' ='Year' then
"Sales - CRM Pipeline"."Time"."Enterprise Year" end s_2,
"Sales - CRM Pipeline"."Pipeline Facts"."# of Opportunities" s_3,
"Sales - CRM Pipeline"."Pipeline Facts"."Opportunity Revenue" s_4
FROM "Sales - CRM Pipeline"
ORDER BY 1, 3 ASC NULLS LAST, 2 ASC NULLS LAST
FETCH FIRST 65001 ROWS ONLY

The column formula for period is as below. The tag '@{ftime}' is the reference to the variable set on the
dashboard. The screenshot below shows how to use the variable value as the column heading.

4. Save the analysis and add it to the same dashboard page where the dashboard prompt was added.

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 11 of 13
The screenshots below show an example of the results from the dashboard for each value selected from the
prompt.

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


Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 12 of 13
Copyright 2016, Oracle and/or its affiliates. All rights reserved.
Oracle Proprietary and Confidential - Distributed to Authorized Customers Page 13 of 13

You might also like