Year to date(YTD)

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ysrini9
Participant
Posts: 108
Joined: Tue Jul 12, 2005 2:51 am

Year to date(YTD)

Post by ysrini9 »

Hi All

Please help me on this how to do YTD(Year-To_Date) by using DataStage

Advanced Thank u

Regards
srini
dprasanth
Charter Member
Charter Member
Posts: 90
Joined: Fri Oct 07, 2005 7:55 am

Re: Year to date(YTD)

Post by dprasanth »

ysrini9 wrote:Hi All

Please help me on this how to do YTD(Year-To_Date) by using DataStage

Advanced Thank u

Regards
srini
Do you want to convert a DATE TO YEAR FORMAT , I mean 25-08-2006 and just want to extract 2006?
Then try this
Oconv(Iconv(Arg1,"D-DMY"), "D-Y")
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What is the input and what is the desired output?
If the input is given as 2006, do you want to convert it as 01-01-2006 or 31-12-2006?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"Year to date" might be a transformation, or it might be a summing of values for all dates in the current year up to today. Which are you trying to do?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ysrini9
Participant
Posts: 108
Joined: Tue Jul 12, 2005 2:51 am

Year to date(YTD)

Post by ysrini9 »

ray.wurlod wrote:"Year to date" might be a transformation, or it might be a summing of values for all dates in the current year up to today. Which are you trying to do? ...
Hi

it is a summing of values for all dates in the current year up to today.

Regards
srini
pigpen
Participant
Posts: 38
Joined: Thu Jul 13, 2006 2:51 am

Post by pigpen »

Do you mean something like this?
Oconv(Date(), "DJ")
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not in a routine.

For preference use SQL.

If you must use a DataStage job, use a selection filter (or a constraint in a Transformer stage) and aggregate the sum either in a stage variable or in an Aggregator stage downstream of the Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

ysrini9 - Why do you want to create duplicate post. You other post "YTD Problem" will also lead to the same sort of solution.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply