Page 1 of 1

Year to date(YTD)

Posted: Mon Aug 21, 2006 1:49 am
by ysrini9
Hi All

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

Advanced Thank u

Regards
srini

Re: Year to date(YTD)

Posted: Mon Aug 21, 2006 2:22 am
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")

Posted: Mon Aug 21, 2006 2:33 am
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?

Posted: Mon Aug 21, 2006 9:23 am
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?

Year to date(YTD)

Posted: Wed Aug 23, 2006 11:50 pm
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

Posted: Thu Aug 24, 2006 12:41 am
by pigpen
Do you mean something like this?
Oconv(Date(), "DJ")

Posted: Thu Aug 24, 2006 1:10 am
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.

Posted: Thu Aug 24, 2006 1:14 am
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.