Create a Cross Subject Query with a Date Prompt
Here's how you can create a cross subject area query that includes a date prompt.
Create a Cross Subject Query with a Date Prompt
-
Start in Oracle Transactional Business Intelligence
-
Click Create and select the Workforce Management - Worker Assignment Real Time subject area.
-
Expand the Worker subject area. Add the Person Number and Name columns.
-
Select Name and First Name.
-
Select the Filter icon.
You only want to view active workers, so add the Assignment Status Type Code column.
-
Choose More Columns.
-
Choose Assignment Status Type Code and click OK.
-
Set the Operator to is not equal to/is not in. Then, add a filter so only Active workers are displayed.
-
Set the Value to Inactive and click OK
-
Click the Results tab.
-
Click the Table Properties icon. Enable Content Paging to show the scroll bars on your report, then return to the Criteria tab.
-
Select Content Paging and Click OK.
-
Return to the Criteria tab.
-
Collapse the Worker Subject Area. You must cross subject areas to include a measure from every subject area. So, in this case, pull in the Assignment Count column.
-
Expand the Worker Assignment Subject Area and select Assignment Count.
-
Return to the Results tab. Now view the results.
-
Return to the Criteria tab. The assignment count is all 1’s. We don’t need to see that, so we will hide it.
-
Select the Settings icon in the Assignment Count column
-
Choose Column Properties.
-
On the Column Format tab, choose Hide.
-
Click OK.
-
Click the Results tab. Return to the Results tab. Although the criteria is still considered for the report, it is no longer displayed.
-
Click the Criteria tab. Return to the Criteria tab.
-
Collapse the Workforce Management Worker Assignments Subject area
-
Click the Add/Remove Subject Area icon Now add the second subject area.
-
Add Compensation - Salary Details Real Time
-
Click OK.
-
Expand Compensation Salary Details Real Time, because you need a measure for every subject area, add Annualized Full-Time Salary.
-
Expand Salary and choose Annualized Full-Time Salary.
-
Click the Results tab. The result is a cross-subject area query that includes annualized full-time salary.
Note that some people do not have a Salary.
-
Click Advanced tab. Next, set the query to be effective as of a specific date.
-
Paste the following code in the Advanced SQL Clauses Prefix area:
SET VARIABLE PARAM_EFFECTIVE_DATE='@{ P_DATE }{@{system.currentTime}[yyyy-MM-dd]}';
This code sets a variable called Param effective date to a value of PA_DATE, which we haven't defined yet.
If a PA_DATE is not set, then the current system date and time are used. If there's no parameter, it will use the code date time.
-
Click Apply SQL.
-
Click the Results tab. View the results. Notice that the report, displays the same results because it's using the same effective date.
-
Click the Prompts tab. So, set up a prompt to provide the effective date.
-
Choose Create a Variable Prompt.
-
Edit the new prompt as follows:
-
Prompt variable: P_Date
-
User Input: Choice list
-
Choice list values: All Column Values
-
Column: Select any date value such as Worker Person Date of Birth.
-
In the Default Selection SQL results statement area, enter: select current_date from “”Workforce Management – Worker Assignment Real Time” Assign a variable prompt called P_DATE and label it Effective Date.
-
-
Click OK
-
Edit the prompt again to change the User Input from Choice List to Calendar and click OK. Here is what the Effective Date Prompt will look like.
-
Click Save to save your prompt as Date Prompt.
-
Choose Date Prompt.
Click OK.
-
Click the Catalog tab.
Now test the date prompt.
-
Click Date prompt. The report is updated to reflect the new date.