Aggregator stage

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
Dana_Dwh
Participant
Posts: 2
Joined: Wed Sep 17, 2008 10:01 am
Location: USA

Aggregator stage

Post 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
Thanks
Dana
gabrielac
Participant
Posts: 29
Joined: Mon Sep 26, 2005 3:39 pm

Post 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
Aruna Gutti
Premium Member
Premium Member
Posts: 145
Joined: Fri Sep 21, 2007 9:35 am
Location: Boston

Post 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.
Dana_Dwh
Participant
Posts: 2
Joined: Wed Sep 17, 2008 10:01 am
Location: USA

Post 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
Thanks
Dana
Aruna Gutti
Premium Member
Premium Member
Posts: 145
Joined: Fri Sep 21, 2007 9:35 am
Location: Boston

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

  • SELECT MIN(datecolumn),MAX(datecolumn) FROM schema.tablename;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply