Page 1 of 1

how to get min date in transformer

Posted: Thu Dec 29, 2011 10:48 am
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

Posted: Thu Dec 29, 2011 4:57 pm
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!

Posted: Wed Jan 04, 2012 11:20 am
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..