Page 1 of 1
Aggregator stage
Posted: Wed Sep 17, 2008 10:13 am
by Dana_Dwh
i want to do an aggrigation max/min on date column comming from source - oracle
please Advice how can i achive this
Posted: Wed Sep 17, 2008 10:21 am
by gabrielac
Order by key columns and date, and use the Remove Duplicates stage. You can choose to keep the first or last row, which would be the same a min or max date.
HTH,
Gaby
Posted: Wed Sep 17, 2008 10:39 am
by Aruna Gutti
This is what I did for getting Maximun date in an Aggregator Stage :
Converted the date to an Integer.
Used Maximum Value Output Column option.
Converted the Integer back to date.
Regards,
Aruna.
Posted: Wed Sep 17, 2008 10:49 am
by Dana_Dwh
Thanks for the response
Hi Aruna
can you please let me know how u changed timestamp to integer and back to timestamp
Thanks in Advance
Posted: Wed Sep 17, 2008 2:01 pm
by Aruna Gutti
Hi Dana,
I was using Date and not Timestamp but I am sure you can use the same logic for Timestamp too.
In a prior transformer stage I used AsInteger(Convert("-","", DateToString(Date,"%yyyy-%mm-%dd"))) to convert Date to integer and after the Aggregator stage reconverted the Integer back to Date in a later Transformer stage.
Please do not use "Preserve type = True" option in aggregator for this field.
Aruna.
Posted: Wed Sep 17, 2008 3:25 pm
by ray.wurlod
- SELECT MIN(datecolumn),MAX(datecolumn) FROM schema.tablename;