Page 1 of 1

Reg: Date Dimension load

Posted: Sun Sep 30, 2007 10:56 am
by nkreddy_3
Hi,

I am quite new to Datastage Paralell jobs. Need your help very much

As I need to load the data into the time dimension as part of that I need to generate a data for column called DAY_CAL_QTR. The data that I need to load into this column is Day number of the Calendar Quarter

Example: from 1 to 90 (end of quarter)

Again for quarter2 the number should start from 1 and ends with the last day of the quarter 91 or 91 etc.., the same way for all the other quarters.

Hope you understand the situation.

Must appriciate your help.

Thanks,
Karunakar

Posted: Sun Sep 30, 2007 2:30 pm
by chulett
Stage variable - start it at 1 and increment until you hit the first day of the next quarter, where you reset it back to 1.

Posted: Sun Sep 30, 2007 8:07 pm
by nkreddy_3
chulett wrote:Stage variable - start it at 1 and increment until you hit the first day of the next quarter, where you reset it back to 1. ...


Hi criag,

Thanks for the reply.

Please let me know how to find out the first day of the quarter. Is they any functions as such?



Thanks,
Karunakar

Posted: Sun Sep 30, 2007 8:15 pm
by ArndW
There is no direct function to get quarter, but you could extract the month number, then take the truncated result of dividing by 4.

Posted: Sun Sep 30, 2007 8:28 pm
by nkreddy_3
ArndW wrote:There is no direct function to get quarter, but you could extract the month number, then take the truncated result of dividing by 4. ...


could you please explain it better. As I did not get the exact point.

Thanks in advance

Karunakar

Posted: Sun Sep 30, 2007 8:30 pm
by nkreddy_3
ArndW wrote:There is no direct function to get quarter, but you could extract the month number, then take the truncated result of dividing by 4. ...


could you please explain it better. As I did not get the exact point.

Thanks in advance

Karunakar

Posted: Sun Sep 30, 2007 9:25 pm
by ray.wurlod
Just map the month number onto the quarter number.
1,2,3 -> 1
4,5,6 -> 2
7,8,9 -> 3
10,11,12 -> 4
The easiest way to do this is with arithmetic - take the month number, add 2, then take the remainder after integer division by 3.