how to get min date in transformer

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
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

how to get min date in transformer

Post by developeretl »

Hi,
Here is the scenario. I have populate the column B based on the Column A.
I have get the min date of ColA and compare it to all the dates in Col A and see if it is less then i have populate in Col B to check whether it should be enddated.
Can you anyone please let me know how to implement this logic using transformer ?

A B
8/11/2011
9/1/2011
10/11/2011
11/12/2011
8/11/2011
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why "using Transformer"? Surely an Aggregator is the correct stage type to get a minimum value. You could also sort the data by date and use a Remove Duplicates to keep only the minimum.

There's also a flaw in your logic.
developeretl wrote:I have get the min date of ColA and compare it to all the dates in Col A and see if it is less
- It IS! That's what minimum means!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post by nagarjuna »

Use aggregator stage & use the option preserve datatype to get the o/p datatype in date or you can also use stage variables in a transformer stage to get the min value..
Nag
Post Reply