Steps to Create variables
1) Open the Variable Manager.
2) Create an initialization block.
3) Edit the data source.
4) Edit the data target.
5) Test the initialization block query.
6) Use the variable to determine content.
7) Verify your work.
1)
Open the Variable Manager.
2)
Create an initialization block.
3) New > Repository > Initialization Block
9)
Click Test and confirm the expected results are
returned. In this example, the results are determined by the data in the sample
database used for this tutorial, which holds data through December 2010. Close
the window.
12)
Leave the
default refresh interval set to every hour. This means that the variables will
be reinitialized every hour.
13)
Click the Test button and check the results. In this
example, the results are determined by the data in the sample database used for
this tutorial, which holds data through December 2010.
14)
Check your work in the Variable Manager. Close the variable
Manager and save the repository and check consistency.
1) Open the Variable Manager.
2) Create an initialization block.
3) Edit the data source.
4) Edit the data target.
5) Test the initialization block query.
6) Use the variable to determine content.
7) Verify your work.
Manage > Variables
3) New > Repository > Initialization Block
4)
Name it as current Period and click on Edit Data
Source.
5)
Click the Edit
Data Source button to
open the Repository Variable Initialization Block Data Source dialog box.
6)
Click the Browse
button to open
the Select Connection Pool dialog box and double click on Connection pool
object to select it.
7)
The connection pool is added.
8)
Enter the following SQL to determine the value of the current day,
month, and year by finding the maximum value of the period key (BILL_DAY_DT) in
the fact table:
SELECT
CALENDAR_DATE, PER_NAME_MONTH, PER_NAME_YEAR FROM BISAMPLE.SAMP_TIME_DAY_D
WHERE CALENDAR_DATE = (SELECT MAX(BILL_DAY_DT) FROM BISAMPLE.SAMP_REVENUE_F)
10)
Create Variable
Click Edit
Data Target to
open the Repository Variable Initialization Block Variable Target dialog box.
11)
Use the New button to create three new variables: CurrentDay, CurrentMonth, CurrentYear. The order is important. Click OK to close the Repository Variable
Initialization Block Variable Target dialog box.
Close the window.
15)
Test your work.
No comments:
Post a Comment