Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.4K Intelligent Advisor
- 75 Insurance
- 537.7K On-Premises Infrastructure
- 138.7K Analytics Software
- 38.6K Application Development Software
- 6.1K Cloud Platform
- 109.6K Database Software
- 17.6K Enterprise Manager
- 8.8K Hardware
- 71.3K Infrastructure Software
- 105.4K Integration
- 41.6K Security Software
how to find the maximum among records?

Hello. I work in Oracle EDQ 11.7.4, the customer has requested such a task. Did not find the maximum search components in this instrument have been decided by a Message Handling Script component.
I wrote in the component Message Handling Script script:
var max = 0;
for (var i = 0; i <records.length; i ++)
{
if (max <records [i] .input1) max = records [i] .input1;
}
for (var i = 0; i <records.length; i ++)
{
if (max == records [i] .input1) records [i] .output1 = 'max';
}
where input1 and output1 variables that default to the input and output values for the component. But the problem is that the time for one component processes only one record (records.length always 1) and after processing the record, goes to the second, third and so on and re-executes the code, i.e. variable max = 0. Those. it turns out, all the records obtained at the output of 'max' which correspond to the input attribute of each record.
I'm sorry, I have bad English, Google Translate
Best Answer
-
Try with Group and Merge processor. Group by common value and Take Highest Value in merge sub processor.
Answers
-
Unless you are working with a multi-record, single message input in real-time processing, you should not be using message handling script for this.
Unfortunately, it is not very clear what your requirement is.
-
Try with Group and Merge processor. Group by common value and Take Highest Value in merge sub processor.
-
It is not advisable to group huge numbers of records (e.g. a whole data set) with Group and Merge.
To determine the max values for each attribute in a data set, you should stage results output of the Max/Min Profiler.