Comparison with Greater than

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
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Comparison with Greater than

Post by Nagac »

Hi

I need all records from File1 which are satifies File1.Date>File2.Date(field is from File2).

Which stage can be used to achieve this?

Thanks in advace
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Re: Comparison with Greater than

Post by samyamkrishna »

Use join stage.
soumya5891
Participant
Posts: 152
Joined: Mon Mar 07, 2011 6:16 am

Re: Comparison with Greater than

Post by soumya5891 »

Depending upon your data volume use join stage or look up stage and then a filter stage
Soumya
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

How do we use Join or Lookup stage.

I tried but i could not find any option to compare with this logic. one more thing is that we dont have matched key fields. we get only one value from reference data(File2.date).
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Use Column Generator stages to add a match key with a single value to both inputs, then use a lookup to match them together and place File2.date on the output. Use a Filter or Transformer to compare the dates after the lookup.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
soumya5891
Participant
Posts: 152
Joined: Mon Mar 07, 2011 6:16 am

Post by soumya5891 »

You can also use transformer stage in both the source to derive a user defined col and then do a look up on the basis of those columns
Soumya
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A range lookup would probably work, with the upper end of the range being some absurdly large value.
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