Hi,
I need to output the min and max values of a column . Is there any function or feature for this.
Could anyone suggest a solution for this.
Thanks.
Sri.
MIn & MAX features
Moderators: chulett, rschirm, roy
Hi Sri
Have you looked at the Aggregator stage? That could be one solution, but my experience of this stage is that it takes a while to do the necessary computations (especially with a few hundred thousand rows).
Another solution would be to use an ODBC stage and just do a select from the tables - let the db do the work.
Have you looked at the Aggregator stage? That could be one solution, but my experience of this stage is that it takes a while to do the necessary computations (especially with a few hundred thousand rows).
Another solution would be to use an ODBC stage and just do a select from the tables - let the db do the work.
dnzl
"what the thinker thinks, the prover proves" - Robert Anton Wilson
"what the thinker thinks, the prover proves" - Robert Anton Wilson
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use a stage variable for each, for example called MinCol and MaxCol.
MinCol is derived asMaxCol is derived as In the final row you will have the desired information.
This is just one solution of many.
MinCol is derived as
Code: Select all
If InLink.TheCol < MinCol Then InLink.TheCol Else MinCol
Code: Select all
If InLink.TheCol > MaxCol Then InLink.TheCol Else MaxCol
This is just one solution of many.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Whatever you like, depending on design.
The dummy line on the end of the input file.
The last line of the output file (tail -1 outputfile).
The Aggregator stage featuring a "Last" aggregate function.
(Over)Write to hashed file with constant key value.
Replace row in table.
@OUTROWNUM = previously-known row count.
and so on
The dummy line on the end of the input file.
The last line of the output file (tail -1 outputfile).
The Aggregator stage featuring a "Last" aggregate function.
(Over)Write to hashed file with constant key value.
Replace row in table.
@OUTROWNUM = previously-known row count.
and so on
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Found this in the Release Notes for 7.5:
Why don't they spread a little more of that around, eh?End-of-Data Row in IMS Stages
-----------------------------
The IMS stage now includes the option to add an end-of-data indicator after the last row is processed on the output link.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers