Guang Ming wrote:Hi guys... Im now struggling using tm1 process using advanced parameters tab. I need to import data from oracle data source to cube. Data source Query result shows some variables, one of them has 'Year' variable. Query result shows 'year' : 2008, 2009, 2010, etc. Now Im thinking how to make a year parameter, so I need to create paramater in tab advanced, then parameters, then I insert new parameter, pYear. On Data tab, I write it : pYear = vYear; It caused when I run the process, dialog box popped up and ask me to insert the year. so when I insert year : 2008, only data with year 2008 will be imported to cube. The problem is, even though I tried to insert one of year like 2008, data still imported for all years. Can you help me to figure this out, how can I just filter one of the name of the year? Any guide would help me a lot, sorry for poor english...

"Parameters, yur doing it wrong."
The place that you need to assign the year parameter is in the SQL statement that you use to query the results from Oracle. That would look something like this:
Code: Select all
select COMPANY
, ACCOUNT
, DEPT
, FISCAL_YEAR
, ACCOUNTING_PERIOD
, POSTED_AMT
from YOURTABLE
This query, having no Where clause, would suck out all of the rows from that table. Accordingly you need to change the query to accept a parameter from you, like this:
Code: Select all
select COMPANY
, ACCOUNT
, DEPT
, FISCAL_YEAR
, ACCOUNTING_PERIOD
, POSTED_AMT
from YOURTABLE
where FISCAL_YEAR = ?pYear?
Note the item with question marks on either side of it. That's where we'll substitute your parameter so that it pulls ONLY the values for the year that you've specified.
If you are entering the parameter into the process' dialog, that's it, you're done. But if you're running the process as part of a chore and are picking up the year from, say, a control cube so that you don't have to manually enter it, you assign the value that you've read from the control cube not in the Data tab, but in the Prolog tab.
The prolog tab is run before any data is read. Supposing that you enter 2008 as the year, then what will happen is that:
- The Prolog tab will run; and
- The SQL code will be changed to read
Code: Select all
select COMPANY
, ACCOUNT
, DEPT
, FISCAL_YEAR
, ACCOUNTING_PERIOD
, POSTED_AMT
from YOURTABLE
where FISCAL_YEAR = 2008
THEN the query above will be run from Oracle. In that way you will receive only the 2008 year's records.
I note from the e-mail alerts that Michel beat me to this one but since I'm already this far through mine I'll post it anyway.