Friday, 23 October 2015

OBIEE 11G Creating Column Selector and View Selector Views

 OBIEE 11G Creating Column Selector and View Selector Views


A Column Selector view adds a column selector to the results. A column selector is a drop-down list from which users can dynamically change the columns that display in results. This will allow you to analyze data along several dimensions. By changing the measure columns, you can dynamically alter the content of the analyses you have created.
To create a Column Selector and View Selector views, perform the following steps:
1 . a. Open the Regional Revenue analysis in the Analysis Editor. The Results tabbed page appears.
Screenshot for Step
b. Click the New View icon and select Other Views > Column Selector.
Screenshot for Step
2 . The Column Selector view appears. Drag the Column Selector view above the Title view.
Screenshot for Step
Click the Edit View icon for the Column Selector view. The Column Selector editor appears.
Screenshot for Step
3 . a. Select the Include Selector C50 Region check box.
Screenshot for Step
b. In the Label (optional) Choices text box, enter Choose a column:.
c. With Column still selected, double-click the following columns to add to the selector: P4 Brand, P3 LOB, and P2 Product Type.
Screenshot for Step
d. Click Done.
The Compound Layout appears:
Screenshot for Step
4 . a. Click the Column Selector drop-down list and select P3 LOB:
Screenshot for Step
b. The values change appropriately. Note, however, that because you set a custom heading for the C50 Region column earlier, the custom heading is still displayed for the column.
Screenshot for Step
c. Save the analysis.
5 . Now you will add the View Selector view.
A View Selector view provides a drop-down list from which users can select a specific view of analysis results from among saved views. A View Selector view is analogous to a storage container, because it holds other views that have been selected in the editor for display.
a. Perform these steps before adding the View Selector view:
  • Delete the Title view from the Compound Layout.
  • Set the Column Selector to display the C50 Region column, which is the default. Then delete the Column Selector view from the Compound Layout.
Screenshot for Step
  • Add a Graph view - Vertical Bar graph.
Screenshot for Step
These changes will allow you to showcase the analytic data-driven views. Regional Revenue should look like this:
Screenshot for Step
6 . a. Click the New View icon on the toolbar and select Other Views > View Selector.
Screenshot for Step
b. Drag the View Selector view to the right of the Table view.
Screenshot for Step
c. Click the Edit View icon for the View Selector view.
7 . a. The View Selector editor appears.In the Caption text box, enter Choose a view:.
Screenshot for Step
b. In the Available Views list, select the Table and Graph views and click the shuttle icon to move them to the Views Included list.
Screenshot for Step
A preview appears at the bottom of the editor. Note that these views are data-driven views, unlike the Column Selector and Title views, which were deleted from the Compound Layout.
Screenshot for Step
c. Click Done.
8 . The Compound Layout should look like this when the Graph view is selected:
Screenshot for Step
Do not save your changes to the analysis.

OBIEE - Selecting column dynamically - part1, column selector

 OBIEE - Selecting column dynamically - part1, column selector


In OBIEE, in Analysis, we can use column selector to dynamically change a column in the analysis. Unfortunately, in complex cases, when you have to use the selected column few times, or you have some complex dependency between selected columns, we have to move the selection to prompts.
In the following 5 posts I will describe:
  1. How to use column selectors. (this post)
  2. How to use column names in prompts with presentation Variables.
  3. How to use better looking column names in prompts.
  4. How to remove column from analysis with column selector or prompt. 
  5. How to create analysis with one prompt to cover multiple columns.
Lets start with column selector.
I have a simple analysis with "Per Name Year", "Product Type", "Revenue" and "Billed Quantity":
Now I want to let the user select other columns instead of "Product Type" and "Billed Quantity". Al I have to do is add column selector in OBIEE:
After pressing "Edit View" on Column Selector, I can edit it:
Mark the desired column and select other options from the list on the left.
Please note: 
  • We can change both the column properties and function of each selection.
  • The clear choices option.
  • While we can place a non-measure column in a measure column selector it's not always a good idea ("Organization", that replaces "Billed Quantity", in my case).
Now the user can select a column. OBIEE actually replaces the column in the select statement, so the result is efficient. 
In the following case we replaced "Product Type" with "Department". 
But when I try and replace "Billed Quantity" with "Organization", I have problems in places that treat that column as measure, such as Pivot and Graph, but not in other, such as Table:
If we decide to add labels to columns:
The Label Position option becomes relevant:
Unmarking the automatically refresh option, lets the user select few options in column selector and then press OK.
One more logical result: if selected in column selector, the column is not controlled  via the Criteria:
If this is so good, why do I need other options? For complex cases.
I will talk about that in the next posts.

Thursday, 15 October 2015

Calendar Date/Time Functions IN OBIEE

 Calendar Date/Time Functions IN OBIEE



The calendar date/time functions manipulate data of the data types DATE and DATETIME based on a calendar year. You must select these functions together with another column; they cannot be selected alone.

Functions :

Current_Date
Current_Time
Current_TimeStamp
Day_Of_Quarter
DayName
DayOfMonth
DayOfWeek
DayOfYear
Hour
Minute
Month
Month_Of_Quarter
MonthName
Now
Quarter_Of_Year
Second
TimestampAdd
TimestampDiff
Week_Of_Quarter
Week_Of_Year
Year



Current_Date
Returns the current date. The date is determined by the system in which the Oracle BI Server is running.
Syntax
Current_Date

Current_Time
Returns the current time. The time is determined by the system in which the Oracle BI Server is running.
Note: The Analytics Server does not cache queries that contain this function.
Syntax
Current_Time(integer)
Where:
integer
Any integer that represents the number of digits of precision with which to display the fractional second.

Current_TimeStamp
Returns the current date/timestamp. The timestamp is determined by the system in which the Oracle BI Server is running.
Note: The Oracle BI Server does not cache queries that contain this function.
Syntax
Current_TimeStamp(integer)
Where:
integer
Any integer that represents the number of digits of precision with which to display the fractional second.

Day_of_Quarter
Returns a number (between 1 and 92) corresponding to the day of the quarter for the specified date.
Syntax
Day_Of_Quarter(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

DayName
Returns the name of the day for a specified date.
Syntax
DayName(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

DayOfMonth
Returns the number corresponding to the day of the month for a specified date.
Syntax
DayOfMonth(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

DayOfWeek
Returns a number between 1 and 7 corresponding to the day of the week, Sunday through Saturday, for a specified date. For example, the number 1 corresponds to Sunday and the number 7 corresponds to Saturday.
Syntax
DayOfWeek(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

DayOfYear
Returns the number (between 1 and 366) corresponding to the day of the year for a specified date.
Syntax
DayOfYear(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

Hour
Returns the number (between 0 and 23) corresponding to the hour for a specified time. For example, 0 corresponds to 12 A.M. and 23 corresponds to 11 P.M.
Syntax
Hour(timeExpr)
Where:
timeExpr
Any expression that evaluates to a time.

Minute
Returns the number (between 0 and 59) corresponding to the minute for a specified time.
Syntax
Minute(timeExpr)
Where:
timeExpr
Any expression that evaluates to a time.

Month
Returns a number (between 1 and 12) corresponding to the month for a specified date.
Syntax
Month(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

Month_Of_Quarter
Returns the number (between 1 and 3) corresponding to the month in the quarter for a specified date.
Syntax
Month_Of_Quarter(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

MonthName
Returns the name of the month for a specified date.
Syntax
MonthName(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

Now
Returns the current timestamp. This function is equivalent to the function current_timestamp .
Syntax
Now()

Quarter_Of_Year
Returns the number (between 1 and 4) corresponding to the quarter of the year for a specified date.
Syntax
Quarter_Of_Year(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

Second
Returns the number (between 0 and 59) corresponding to the seconds for a specified time.
Syntax
Second(timeExpr)
Where:
timeExpr
Any expression that evaluates to a time.

TimestampAdd
Adds a specified number of intervals to a specified timestamp, and returns a single timestamp. Passing a null intExpr or timeExpr to this function results in the return of a null value.
In the simplest scenario, this function simply adds the specified integer value to the appropriate component of the timestamp, based on the interval. Adding a week translates to adding seven days, and adding a quarter translates to adding three months. A negative integer value results in a subtraction (such as going back in time).
An overflow of the specified component (for example, more than 60 seconds, 24 hours, twelve months, and so on) necessitates adding an appropriate amount to the next component. For example, when adding to the day component of a timestamp, this function makes sure that overflow takes into account the number of days in a particular month (including leap years). Similar measures are used to make sure that adding a month component results in the appropriate number of days for the day component (such as adding a month to '2010-05-31' does not result in '2010-06-31' because June does not have 31 days). The function also deals with the month and day components in a similar fashion when adding or subtracting year components.
Syntax
TimestampAdd(interval, intExpr, timestamp)
Where:
interval
The specified interval. Valid values 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.
intExpr
Any expression that evaluates to an integer value.
timestamp
Any valid timestamp.
Examples
Select {TimestampAdd(SQL_TSI_DAY, 3, TIMESTAMP'2000-02-27 14:30:00')}
From Employee where employeeid = 2;
In the above example, the query asks for the resulting timestamp when 3 days are added to '2000-02-27 14:30:00'. Since February, 2000 is a leap year, the query returns a single timestamp of '2000-03-01 14:30:00'.
Select {TimestampAdd(SQL_TSI_MONTH, 7, TIMESTAMP'1999-07-31 00:00:00')}
From Employee where employeeid = 2;
In the above example, the query asks for the resulting timestamp when 7 months are added to '1999-07-31 00:00:00'. The query returns a single timestamp of '2000-02-29 00:00:00'. Notice the reduction of day component to 29 because of the shorter month of February.
Select {TimestampAdd(SQL_TSI_MINUTE, 25, TIMESTAMP'2000-07-31 23:35:00')}
From Employee where employeeid = 2;
In the above example, the query asks for the resulting timestamp when 25 minutes are added to '2000-07-31 23:35:00'. The query returns a single timestamp of '2000-08-01 00:00:00'. Notice the propagation of overflow through the month component.

TimestampDiff
Returns the total number of specified intervals between two timestamps. Passing a null timestamp to this function results in a null return value.
This function first determines the timestamp component that corresponds to the specified interval parameter, and then looks at the higher order components of both timestamps to calculate the total number of intervals for each timestamp. For example, if the specified interval corresponds to the month component, the function calculates the total number of months for each timestamp by adding the month component and twelve times the year component. Then the function subtracts the first timestamp's total number of intervals from the second timestamp's total number of intervals.
The TimestampDiff function rounds up to the next integer whenever fractional intervals represent a crossing of an interval boundary. For example, the difference in years between '1999-12-31' and '2000-01-01' is 1 year because the fractional year represents a crossing from one year to the next (such as 1999 to 2000). By contrast, the difference between '1999-01-01' and '1999-12-31' is zero years because the fractional interval falls entirely within a particular year (such as 1999). Microsoft's SQL Server exhibits the same rounding behavior, but IBM's DB2 does not; it always rounds down. Oracle does not implement a generalized timestamp difference function.
When calculating the difference in weeks, the function calculates the difference in days and divides by seven before rounding. Additionally, the function takes into account how the administrator has configured the start of a new week in the NQSConfig.ini file. For example, with Sunday as the start of the week, the difference in weeks between '2000-07-06' (a Thursday) and '2000-07-10' (the following Monday) results in a value of 1 week. With Tuesday as the start of the week, however, the function would return zero weeks since the fractional interval falls entirely within a particular week. When calculating the difference in quarters, the function calculates the difference in months and divides by three before rounding.
Oracle BI Server pushes down the TIMESTAMPADD and TIMESTAMPDIFF functions to Microsoft's SQL Server and ODBC databases by default. While Oracle BI Server can also push to IBM's DB2, the features table is turned off by default due to DB2's simplistic semantics. (IBM's DB2 provides a generalized timestamp difference function, TIMESTAMPDIFF, but it simplifies the calculation by always assuming a 365-day year, 52-week year, and 30-day month.) The features table is also turned off by default for Oracle, since Oracle databases do not fully support these functions.
Syntax
TimestampDiff(interval, timestamp1, timestamp2)
Where:
interval
The specified interval. Valid values 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.
timestamp1
Any valid timestamp.
timestamp2
Any valid timestamp.
Examples
Select {TimestampDiff(SQL_TSI_DAY, TIMESTAMP'1998-07-31 23:35:00', TIMESTAMP'2000-04-01 14:24:00')}
From Employee where employeeid = 2;
In the above example, the query asks for a difference in days between timestamps '1998-07-31 23:35:00' and '2000-04-01 14:24:00'. It returns a value of 610. Notice that the leap year in 2000 results in an additional day.

Week_Of_Quarter
Returns a number (between 1 and 13) corresponding to the week of the quarter for the specified date.
Syntax
Week_Of_Quarter(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

Week_Of_Year
Returns a number (between 1 and 53) corresponding to the week of the year for the specified date.
Syntax
Week_Of_Year(dateExpr)
Where:
dateExpr
Any expression that evaluates to a date.

Year
Returns the year for the specified date.
Syntax
Year(dateExpr)
Where:
dateExpr Any expression that evaluates to a date.

Monday, 5 October 2015

KINH DOANH- TIẾP THỊ


   
  CHINH PHỤC KHÁCH HÀNG
   
CHỦ ĐỀ
   
KH01 •       Nghệ Thuật Chinh Phục Khách Hàng
KH02 •       Thuật Tấn Công Tâm Lý Trong Bán Lẻ
KH03 •       Biến Bất Kỳ Ai Thành Khách Hàng
KH04 •       Bí Kíp Chinh Phục Khách Hàng Qua Điện Thoại
KH05 •       Hoàn Thiện Nghệ Thuật Thu Hút Khách Hàng
KH06 •       Bí Quyết Tạo Cơn Sốt Bán Hàng
KH07 •       Nghệ Thuật Bán Hàng Khiêu Khích
KH08 •       Điều Gì Khiến Khách Hàng Chi Tiền
KH09 •       Khách Hàng Muốn Mua Gì
KH10 •       Hãy Suy Nghĩ Tựa Người Mua  
   
   
  BÁN HÀNG
   
CHỦ ĐỀ
   
BH01 •       Vì Sao Ai Cũng Phải Bán Hàng?
BH02 •       Xây Dựng Chiến Lược Hiệu Quả Cho Các Cửa Hàng Bán Lẻ
BH03 •       Có Được Khách Hàng, Giữ Khách Hàng Và Bán Nhiều Sản Phẩm
BH04 •       Đột Phá Và Duy Trì Doanh Số Vượt Trội
BH05 •       Bí Quyết Của Người Bán Hàng Xuất Sắc
BH06 •       Dứt Điểm Lấy Đơn Hàng - Đòn Quyết Định
BH07 •       Nghệ Thuật "Câu" Like
BH08 •       Kiếm Tiền Trên Mạng
BH09 •       Bán Hàng Thông Minh Qua Điện Thoại Internet
   
 
TIẾP THỊ
   
CHỦ ĐỀ
   
TT01 •       Tiếp Thị Tương Tác
TT02 •       Tiếp Thị Trực Tuyến Thông Minh
TT03 •       Tiếp Thị Hiệu Quả
TT04 •       Đo Lường Tiếp Thị- 103 Công Cụ Đo Lường Thiết Yếu Cho Các Chuyên Gia Marketing
TT05 •       Marketing Không Cần Quảng Cáo - Bí Quyết Tạo Dựng Một Doanh Nghiệp Trường Tồn
TT06 •       Marketing Qua Email
TT07 •       22 Quy Luật Bất Biến Trong Marketing
TT08 •       Sự Thật Về Những Thất Bại Trong Tiếp Thị Sản Phẩm
TT09 •       Tìm Hiểu Thị Hiếu Khách Hàng - 12 Nguyên Tắc Thiết Yếu Để Chinh Phục Khách Hàng
TT10 •       Marketing Cho Khách Hàng Trung Niên
TT11 •       Hoạch Định Chiến Lược Marketing   Hiệu Quả
   
   
  THƯƠNG HIỆU
   
CHỦ ĐỀ
   
TH01 •       Bong Bóng Thương Hiệu
TH02 •       Đánh Lửa Cho Thương Hiệu - Chiến Lược Thương Hiệu
TH03 •       Năng Lực Tự Tiếp Thị - Giới Thiệu Mình Như Một Thương Hiệu
TH04 •       Sự Thật Về 100 Thất Bại Thương Hiệu Lớn Nhất Của Mọi Thời Đại
TH05 •       Thiết Kế Làm Nên Thương Hiệu
   
   
  QUAN HỆ CÔNG CHÚNG
   
CHỦ ĐỀ
   
PR01 •       Những Bí Quyết Căn Bản Để Thành Công Trong PR
PR02 •       Phong Cách PR Chuyên Nghiệp
PR03 •       PR Theo Kiểu Mỹ - Thúc Đẩy
PR04 •       PR Trong Thế Giới Công Nghệ Số
PR05 •       Sáng Tạo Chiến Dịch PR Hiệu Quả
PR06 •       PR Hiệu Quả
   
   
  QUẢNG CÁO
   
CHỦ ĐỀ
   
QC01 •       Nghệ Thuật Quảng Cáo - Bí Ẩn Của Sự Thành Công
QC02 •       Nghệ Thuật Viết Quảng Cáo
QC03 •       Ngôn Ngữ Quảng Cáo - Advertising Language
QC04 •       Thôi Miên Bằng Ngôn Từ
QC05 •       Phương Thức Quảng Cáo Tối Ưu
QC06 •       Quảng Cáo & Tâm Trí Người Tiêu Dùng
QC07 •       Những Ý Tưởng Đột Phá Trong Quảng Cáo
QC08 •       Bí Kíp X Trong Quảng Cáo - PR
 

Friday, 25 September 2015

Using Hints in OBIEE RPD and Answers

Using Hints in OBIEE RPD and Answers

 

1.   Using Hints in OBIEE (Rpd and Answers)

OBIEE supporting hints is kind of limited. The below session brief the usage of hints in obiee. Please note that you may not be able to implement all hints available with OBIEE.

1.1    Physical Object – OBIEE Repository

Hints can be applied in the table/Object in the physical layer. When applied this hint, whenever any request hit the table, this hint will be applied in the physical query generated by OBIEE.

·         Step 1
Open the OBIEE rpd and checkout the physical table where you want to apply the hint

·         Step 2
Go to the General Tab and apply the Hint as shown below

Here I’m implementing the Full hint

Hint Syntax:
/*+ Full (tab_name) */
Table Name: WC_PURCH_COSTREDUC_FORECAST_F



Note: You can also implement the hints without arguments here like “FACT”




·         Step 3
Check in the changes

·         Queries

Example:

OBIEE Physical Query before implementing the FULL Hint

    select T862336.FSCL_PER_NAME_YEAR as c1,
     T862336.FSCL_PER_NAME_QTR as c2,
     T862336.FSCL_PER_NAME_MONTH as c3,
     sum(T863204.FORECAST_SAVING) as c4,
     T862336.FSCL_MONTH as c5,
     T862336.FSCL_QTR as c6,
     T862336.FSCL_YEAR as c7
     from
     WC_SCM_INT_ORG_D_V T888692,
     W_FSCL_MONTH_D T862336,
     WC_PURCH_COSTREDUC_FORECAST_F T863204
where  ( T862336.ROW_WID = T863204.MONTH_NO and T862336.FSCL_PER_NAME_YEAR = '2009' and T863204.INVENTORY_ORG_WID = T888692.ROW_WID and T863204.PART_DELETE_FLAG = 'N' and T888692.USER_GROUP = 'OBIEE_CORP_SCM_GLOBAL' )
group by T862336.FSCL_MONTH, T862336.FSCL_QTR, T862336.FSCL_YEAR, T862336.FSCL_PER_NAME_MONTH, T862336.FSCL_PER_NAME_QTR, T862336.FSCL_PER_NAME_YEAR
order by c1, c2, c3


OBIEE Physical Query after implementing the FULL Hint

     select  /*+ full(T863204) */  T862336.FSCL_PER_NAME_YEAR as c1,
     T862336.FSCL_PER_NAME_QTR as c2,
     T862336.FSCL_PER_NAME_MONTH as c3,
     sum(T863204.FORECAST_SAVING) as c4,
     T862336.FSCL_MONTH as c5,
     T862336.FSCL_QTR as c6,
     T862336.FSCL_YEAR as c7
     from
     WC_SCM_INT_ORG_D_V T888692,
     W_FSCL_MONTH_D T862336,
     WC_PURCH_COSTREDUC_FORECAST_F T863204
where  ( T862336.ROW_WID = T863204.MONTH_NO and T862336.FSCL_PER_NAME_YEAR = '2009' and T863204.INVENTORY_ORG_WID = T888692.ROW_WID and T863204.PART_DELETE_FLAG = 'N' and T888692.USER_GROUP = 'OBIEE_CORP_SCM_GLOBAL' )
group by T862336.FSCL_MONTH, T862336.FSCL_QTR, T862336.FSCL_YEAR, T862336.FSCL_PER_NAME_MONTH, T862336.FSCL_PER_NAME_QTR, T862336.FSCL_PER_NAME_YEAR
order by c1, c2, c3

Note:
The T863204 is the OBIEE table Id for WC_PURCH_COSTREDUC_FORECAST_F table. This will be taken care internally. We can directly give the table name in the hint or this OBIEE physical table id (which can be obtained from by querying rpd).


1.2    Physical Join – OBIEE Repository

Hints can be applied in the physical join of tables in the physical layer. When applied this hint, whenever any request which consumes the join, this hint will be applied in the physical query generated by OBIEE.

·         Step 1
Open the OBIEE rpd and checkout the physical join where you want to apply the hint.

·         Step 2
Apply the hint as shown below
Here I’m implementing the USE_MERGE hint

Hint Syntax:
/*+ USE_MERGE(Table1 Table2) */
Table1 Name: W_FSCL_MONTH_D
Table2 Name: WC_PURCH_COSTREDUC_FORECAST_F


Caution: if you need to implement this hint on a Join where an Alias table is present, Make sure that you pass the OBIEE table ID instead of Table name in the hint.

·         Step 3
Check in the changes

·         Queries
Example:

OBIEE Physical Query before implementing the MERGE Hint
 
select T862336.FSCL_PER_NAME_YEAR as c1,
     T862336.FSCL_PER_NAME_QTR as c2,
     T862336.FSCL_PER_NAME_MONTH as c3,
     sum(T863204.FORECAST_SAVING) as c4,
     T862336.FSCL_MONTH as c5,
     T862336.FSCL_QTR as c6,
     T862336.FSCL_YEAR as c7
     from 
     WC_SCM_INT_ORG_D_V T888692,
     W_FSCL_MONTH_D T862336,
     WC_PURCH_COSTREDUC_FORECAST_F T863204
where  ( T862336.ROW_WID = T863204.MONTH_NO and T862336.FSCL_PER_NAME_YEAR = '2006' and T863204.INVENTORY_ORG_WID = T888692.ROW_WID and T863204.PART_DELETE_FLAG = 'N' and T888692.USER_GROUP = 'OBIEE_CORP_SCM_GLOBAL' ) 
group by T862336.FSCL_MONTH, T862336.FSCL_QTR, T862336.FSCL_YEAR, T862336.FSCL_PER_NAME_MONTH, T862336.FSCL_PER_NAME_QTR, T862336.FSCL_PER_NAME_YEAR
order by c1, c2, c3


OBIEE Physical Query after implementing the MERGE Hint
 
select  /*+ USE_MERGE(W_FSCL_MONTH_D WC_PURCH_COSTREDUC_FORECAST_F) */  T862336.FSCL_PER_NAME_YEAR as c1,
     T862336.FSCL_PER_NAME_QTR as c2,
     T862336.FSCL_PER_NAME_MONTH as c3,
     sum(T863204.FORECAST_SAVING) as c4,
     T862336.FSCL_MONTH as c5,
     T862336.FSCL_QTR as c6,
     T862336.FSCL_YEAR as c7
     from 
     WC_SCM_INT_ORG_D_V T888692,
     W_FSCL_MONTH_D T862336,
     WC_PURCH_COSTREDUC_FORECAST_F T863204
where  ( T862336.ROW_WID = T863204.MONTH_NO and T862336.FSCL_PER_NAME_YEAR = '2006' and T863204.INVENTORY_ORG_WID = T888692.ROW_WID and T863204.PART_DELETE_FLAG = 'N' and T888692.USER_GROUP = 'OBIEE_CORP_SCM_GLOBAL' ) 
group by T862336.FSCL_MONTH, T862336.FSCL_QTR, T862336.FSCL_YEAR, T862336.FSCL_PER_NAME_MONTH, T862336.FSCL_PER_NAME_QTR, T862336.FSCL_PER_NAME_YEAR
order by c1, c2, c3
 

·         Example 2 – Report Hints
Lets try to implement the hint

'/*+ordered use_nl(T266471) parallel(e, 4) */

EVALUATE('/*+ordered use_nl(T266471) parallel(e, 4) */ %1', "Dim - Time"."Fiscal Year")

1.3    OBIEE Reports

·         Step 1
Identify the “OBIEE physical table id” (physical layer object) for the object (here table) you want to implement the hint.

To get the Physical table id
1.     Go to OBIEE Rpd à toolà query repository and query the Physical layer object as shown below. Here we are querying the physical table W_FSCL_MONTHCOSTREDUC_FORECAST_F. Give the name of the object and select the Type as Physical Table



2.     In the result window, you will get an IUD field.
Here it is 3001:863204. Take the second part of this id after “:” and prefix the ID with the letter “T”. This will be the table id we have to use in the report to represent the table.
The derived table id from the above example is “T863204”

·         Step 2
Open the report you want to implement hint in the report editor.

·         Step 3

Create new column, put the column in the first position in the report, Hide the column and edit the function(fx) for the column as shown below.

Caution: If you are not hiding the column you will see the hint in the group by clause.

Let’s try to implement the FULL Hint via report
Hint Syntax:
/*+ Full (Table Name) */
Table Name: WC_PURCH_COSTREDUC_FORECAST_F

Here I will use an Evaluate function to wrap the hint. The syntax of Evaluate function is EVALUATE('Database Function(%1)', 1st parameter) Eg: EVALUATE('Upper(%1)', 'oracle') will give output as ORACLE. We will use the same technique to implement the hint but with a small change. We will pass the hint with the value (if needed) and then pass the parameter as the Table.Coulmn from the subject area.

So, now our EVALUATE function will look like
EVALUATE(‘/*+FULL(T863204)*/ %1, “Dim- Time”.”Fiscal Year”)

Where
/*+FULL(T863204)*/       à is the hint with Table Id passed as parameter
%1                                àis the first Parameter
“Dim- Time”.”Fiscal Year” àis the subject area table’s column which I’m passing as the value for the first parameter
.

·         Step 4

Save and Run the report
  
·         Queries
Example:

OBIEE Physical Query before  implementing the FULL Hint in REPORT
WITH 
SAWITH0 AS (select D1.c1 as c1,
     D1.c2 as c2,
     D1.c3 as c3,
     D1.c4 as c4,
     D1.c5 as c5,
     D1.c6 as c6,
     D1.c7 as c7,
     D1.c8 as c8
from 
     (select T862336.FSCL_PER_NAME_YEAR as c1,
               T862336.FSCL_PER_NAME_YEAR as c2,
               T862336.FSCL_PER_NAME_QTR as c3,
               T862336.FSCL_PER_NAME_MONTH as c4,
               sum(T863204.FORECAST_SAVING) as c5,
               T862336.FSCL_MONTH as c6,
               T862336.FSCL_QTR as c7,
               T862336.FSCL_YEAR as c8,
               ROW_NUMBER() OVER (PARTITION BY T862336.FSCL_MONTH, T862336.FSCL_QTR, T862336.FSCL_YEAR, T862336.FSCL_PER_NAME_MONTH, T862336.FSCL_PER_NAME_QTR, T862336.FSCL_PER_NAME_YEAR ORDER BY T862336.FSCL_MONTH ASC, T862336.FSCL_QTR ASC, T862336.FSCL_YEAR ASC, T862336.FSCL_PER_NAME_MONTH ASC, T862336.FSCL_PER_NAME_QTR ASC, T862336.FSCL_PER_NAME_YEAR ASC) as c9
          from 
               WC_SCM_INT_ORG_D_V T888692,
               W_FSCL_MONTH_D T862336,
               WC_PURCH_COSTREDUC_FORECAST_F T863204
          where  ( T862336.ROW_WID = T863204.MONTH_NO and T863204.INVENTORY_ORG_WID = T888692.ROW_WID and T863204.PART_DELETE_FLAG = 'N' and T888692.USER_GROUP = 'OBIEE_CORP_SCM_GLOBAL' and (T862336.FSCL_PER_NAME_YEAR in ('2008', '2009')) ) 
          group by T862336.FSCL_MONTH, T862336.FSCL_QTR, T862336.FSCL_YEAR, T862336.FSCL_PER_NAME_MONTH, T862336.FSCL_PER_NAME_QTR, T862336.FSCL_PER_NAME_YEAR
     ) D1
where  ( D1.c9 = 1 ) )
select SAWITH0.c1 as c1,
     SAWITH0.c2 as c2,
     SAWITH0.c3 as c3,
     SAWITH0.c4 as c4,
     SAWITH0.c5 as c5
from 
     SAWITH0
order by c1, c2, c3, c4
 
 


OBIEE Physical Query after implementing the FULL Hint in REPORT

WITH 
SAWITH0 AS (select D1.c1 as c1,
     D1.c2 as c2,
     D1.c3 as c3,
     D1.c4 as c4,
     D1.c5 as c5,
     D1.c6 as c6,
     D1.c7 as c7,
     D1.c8 as c8
from 
     (select /*+FULL(T863204) */ T862336.FSCL_PER_NAME_YEAR as c1,
               T862336.FSCL_PER_NAME_YEAR as c2,
               T862336.FSCL_PER_NAME_QTR as c3,
               T862336.FSCL_PER_NAME_MONTH as c4,
               sum(T863204.FORECAST_SAVING) as c5,
               T862336.FSCL_MONTH as c6,
               T862336.FSCL_QTR as c7,
               T862336.FSCL_YEAR as c8,
               ROW_NUMBER() OVER (PARTITION BY T862336.FSCL_MONTH, T862336.FSCL_QTR, T862336.FSCL_YEAR, T862336.FSCL_PER_NAME_MONTH, T862336.FSCL_PER_NAME_QTR, T862336.FSCL_PER_NAME_YEAR ORDER BY T862336.FSCL_MONTH ASC, T862336.FSCL_QTR ASC, T862336.FSCL_YEAR ASC, T862336.FSCL_PER_NAME_MONTH ASC, T862336.FSCL_PER_NAME_QTR ASC, T862336.FSCL_PER_NAME_YEAR ASC) as c9
          from 
               WC_SCM_INT_ORG_D_V T888692,
               W_FSCL_MONTH_D T862336,
               WC_PURCH_COSTREDUC_FORECAST_F T863204
          where  ( T862336.ROW_WID = T863204.MONTH_NO and T863204.INVENTORY_ORG_WID = T888692.ROW_WID and T863204.PART_DELETE_FLAG = 'N' and T888692.USER_GROUP = 'OBIEE_CORP_SCM_GLOBAL' and (T862336.FSCL_PER_NAME_YEAR in ('2008', '2009')) ) 
          group by T862336.FSCL_MONTH, T862336.FSCL_QTR, T862336.FSCL_YEAR, T862336.FSCL_PER_NAME_MONTH, T862336.FSCL_PER_NAME_QTR, T862336.FSCL_PER_NAME_YEAR
     ) D1
where  ( D1.c9 = 1 ) )
select SAWITH0.c1 as c1,
     SAWITH0.c2 as c2,
     SAWITH0.c3 as c3,
     SAWITH0.c4 as c4,
     SAWITH0.c5 as c5
from 
     SAWITH0
order by c1, c2, c3, c4
 
 
Example -2 
 
Lets try to implement nested loop hint 
 
Syntax:
'/*+ordered use_nl(Table Name ) parallel(e, 4) */ %
 
Evaluate Function to be given in the report col:
EVALUATE('/*+ordered use_nl(T266471) parallel(e, 4) */ %1', "Dim - Time"."Fiscal Year")
 
Where  T266471 is the table id forn OBIEE rpd 
Dim - Time"."Fiscal Year is the column we are calling.
/*--------------------------------CREATED_BY : JJN CREATED_DATE : 07-Jul-2009---------------------------------*/