Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

how to find the maximum among records?

3401804Feb 21 2017 — edited Feb 22 2017

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

This post has been answered by EDQ on Feb 21 2017
Jump to Answer

Comments

Mike-Matthews-Oracle

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.

EDQ
Answer

Try with Group and Merge processor. Group by common value and Take Highest Value in merge sub processor.

Marked as Answer by 3401804 · Sep 27 2020
Mike-Matthews-Oracle

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.

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 22 2017
Added on Feb 21 2017
3 comments
428 views