GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Data Warehousing  >  BO Designer
Go To First  |  Previous Question  |  Next Question 
 BO Designer  |  Question 69 of 117    Print  
How to create Generic TIME CLASS, which includes Objects Year,Month and Qtr?
Database in use is Oracle.

  
Total Answers and Comments: 3 Last Update: June 14, 2006     Asked by: Adi 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 09, 2006 01:41:00   #1  
pat.mclean Member Since: April 2006   Contribution: 52    

RE: How to create Generic TIME CLASS, which includes O...

If your database consist all dates something like 01/02/2000 or 01-Feb-2000 you will need to break the date field into year qtr month & if required date.

to do this create a class named TIME under that create new object in it's select box use oracle's date functions to get required information.

For E.g. : to_char(sales_date 'YYYY') for getting only year from the date.

similarly for quarter you can use to_char(sales_date 'Q')

& for month to_char(sales_date 'MM') for month number instead of 'MM' if you use 'MON' it will return you abrevations like Jan for January & so on. for full name of month use 'MONTH'

Cheers

Pat.


 
Is this answer useful? Yes | No
June 09, 2006 14:56:21   #2  
Adi        

RE: How to create Generic TIME CLASS, which includes O...

Pat

Do i need to have some tabel selected like u have mention sales_date?


 
Is this answer useful? Yes | No
June 14, 2006 01:51:16   #3  
pat.mclean Member Since: April 2006   Contribution: 52    

RE: How to create Generic TIME CLASS, which includes O...

well adi

it is not a table name but column name(sales_date).It can be any name depending upon your ETL process & naming convensions. if you have the database ready & you want to break your dates in discussed format will you process each & every entry from database? certainly not...so simply put a column name ...the column that holds your dates.

you can try the discussed sytax using sysdate (oracle's keyword for current date)

syntax : to_char(sysdate 'YYYY') from dual;

to_char('01-Jan-2006' ''YYYY') from dual;

where dual is inbuilt table in Oracle.


 
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