GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Data Warehousing  >  Basics
Go To First  |  Previous Question  |  Next Question 
 Basics  |  Question 35 of 113    Print  
How do you load the time dimension

  
Total Answers and Comments: 5 Last Update: December 29, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 18, 2005 08:35:18   #1  
ashish arora        

RE: How do you load the time dimension
In Dataware house we manually load the time dimension
 
Is this answer useful? Yes | No
August 03, 2005 20:28:06   #2  
sudhir        

RE: How do you load the time dimension
Every Datawarehouse maintains a time dimension. It would be at the most granular level at which the business runs at (ex: week day day of the month and so on). Depending on the data loads these time dimensions are updated. Weekly process gets updated every week and monthly process every month.
 
Is this answer useful? Yes | No
August 16, 2005 01:09:05   #3  
Sivarao        

RE: How do you load the time dimension
Time dimension in DWH must be load Manually. we load data into Time dimension using pl/sql scripts.
 
Is this answer useful? Yes | No
May 12, 2006 08:42:06   #4  
Raghunath Bhairavajosula        

RE: How do you load the time dimension
Generally we load the Time dimension by using SourceStage as a Seq File and we use one passive stage in that transformer stage we will manually write functions as Month and Year Functions to load the time dimensions but for the lower level i.e. Day also we have one function to implement loading of Time Dimension.
 
Is this answer useful? Yes | No
December 29, 2006 08:47:53   #5  
manisha.sinha Member Since: December 2006   Contribution: 30    

RE: How do you load the time dimension

create a procedure to load data into Time Dimension. The procedure needs to run only once to popullate all the data. For eg the code below fills up till 2015. You can modify the code to suit the feilds in ur table.

create or replace procedure QISODS.Insert_W_DAY_D_PR as
LastSeqID number default 0;
loaddate Date default to_date('12/31/1979' 'mm/dd/yyyy');
begin
Loop
LastSeqID : LastSeqID + 1;
loaddate : loaddate + 1;
INSERT into QISODS.W_DAY_D values(
LastSeqID
Trunc(loaddate)
Decode(TO_CHAR(loaddate 'Q') '1' 1 decode(to_char(loaddate 'Q') '2' 1 2)
)
TO_FLOAT(TO_CHAR(loaddate 'MM'))
TO_FLOAT(TO_CHAR(loaddate 'Q'))
trunc((ROUND(TO_DECIMAL(to_char(loaddate 'DDD'))) +
ROUND(TO_DECIMAL(to_char(trunc(loaddate 'YYYY') 'D')))+ 5) / 7)
TO_FLOAT(TO_CHAR(loaddate 'YYYY'))
TO_FLOAT(TO_CHAR(loaddate 'DD'))
TO_FLOAT(TO_CHAR(loaddate 'D'))
TO_FLOAT(TO_CHAR(loaddate 'DDD'))
1
1
1
1
1
TO_FLOAT(TO_CHAR(loaddate 'J'))
((TO_FLOAT(TO_CHAR(loaddate 'YYYY')) + 4713) * 12) +
TO_number(TO_CHAR(loaddate 'MM'))
((TO_FLOAT(TO_CHAR(loaddate 'YYYY')) + 4713) * 4) +
TO_number(TO_CHAR(loaddate 'Q'))
TO_FLOAT(TO_CHAR(loaddate 'J'))/7
TO_FLOAT (TO_CHAR (loaddate 'YYYY')) + 4713
TO_CHAR(load_date 'Day')
TO_CHAR(loaddate 'Month')
Decode(To_Char(loaddate 'D') '7' 'weekend' '6' 'weekend' 'weekday')
Trunc(loaddate 'DAY') + 1
Decode(Last_Day(loaddate) loaddate 'y' 'n')
to_char(loaddate 'YYYYMM')
to_char(loaddate 'YYYY') || ' Half' ||
Decode(TO_CHAR(loaddate 'Q') '1' 1 decode(to_char(loaddate 'Q') '2' 1 2)
)
TO_CHAR(loaddate 'YYYY / MM')
TO_CHAR(loaddate 'YYYY') ||' Q ' ||TRUNC(TO_number( TO_CHAR(loaddate
'Q')) )
TO_CHAR(loaddate 'YYYY') ||' Week'||TRUNC(TO_number( TO_CHAR(loaddate
'WW')))
TO_CHAR(loaddate 'YYYY'));
If loaddate to_Date('12/31/2015' 'mm/dd/yyyy') Then
Exit;
End If;
End Loop;
commit;
end Insert_W_DAY_D_PR;


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape