Reg: Date Dimension load

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
nkreddy_3

Reg: Date Dimension load

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nkreddy_3

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
nkreddy_3

Post 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
nkreddy_3

Post 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
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply