Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting of current period for the .pyi model

Status
Not open for further replies.

mksmks

Programmer
Mar 27, 2002
17
SG
HI,

I have refresh the cube everyday setting the current period as TODAY. How to do it?
I tried including Today in the iqd file. And then Set the Current period only for that particular data source. But it didnt work. It is always taking the latest date in that particular dimension. I want TODAY to be taken as default current period everyday. Please help me out. This is very crucial.

 
Can you use the NOW() function in the filter of your IQD?
You would say where the CURRENT_PERIOD = NOW(), which would be today's date.
 
Hi,

But where to specify this in the transformer? I have to specify this in the transformer model before I generate the categories. I tried this before ..but doesnt work. Is there a way ...where I can specify the current period as system date of the database in the transformer ...through the iqd?

The now() column is different from the other date columns in the iqd. If I set now() as current period , then transformer takes today's date as current period for this date dimension. For the other date dimensions , it still takes the latest date available in that column.

Please help me in this regard

thanks
 
Hi

If you go to the properties of each of the data sources you have, and under the 'general' tab, set the 'Sets the current period' flag either on (for the iqd with todays date) or off (for everything else) you should have no further problems.

This flag takes the current period from the latest date in the data source file. You should not have to manually perform set current periods.

YOu could have a separate iqd file which just returns todays date for current period assignment.


Kevin **************************************************************
The difference between fiction and reality is that fiction has to make sense.
**************************************************************
 
I had tried this before. But it sets the latest date in that particular dimension to the current period but not to the latest date in the whole data source .
Any idea how to solve this?

Thanks
 
I agree with what quatermass (TechnicalUser)indicated.

1) create a SEPARATE IQD with the now() function indicating system date. That's all that you need to include in this IQD. Indicate on the set current data flag is ON for this dimension. (We also have ours as the FIRST IQD in the list of sources). So the first dimension to get populated is the time dimension based on system date.

2) Make sure the set current flag is OFF for ALL fact tables.


This is what my CurrentPeriod.iqd shows as sql code

select (sysdate()) as c1,
T1."TIME_SID" as c2,
(substring((to_char(trunc(T1."TIME_SID"))) from 1 for 6)) as c3
from "ADM_TIME_DIM" T1
where ((cdate(T1."TIME_SID")) = ((cdate((sysdate())))))
order by c1 asc

good luck!
 
In the datasource properties from which the current period has to be set, select the source tab and check the 'sets the current period' option. In the time dimension properties clikc on the time tab and check the 'Automatically sets the current period'
Hope this helps
 
Hi,

Thanks for your help.
It worked out.
once again thanks a lot.

From yesterday I have been stuck with a new problem. The future dates are present in the datasource. And the model takes the future date as the current period and sets all the relative time categories.

Its been written in the cognos help that one of the ways to set the current period is the mdl script. Any idea how to do it?

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top