Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2695

Re: Mapping - Context

$
0
0

Hi Neil,

 

at the first glace I thought that you can optimize your calculation for total2, because r/u * d/n* n = r/u *d. But then I realized that you want use the NUM value of the first context always for the secound NUM in your calculation.

 

Maybe you can use a combination of udfs to achieve this:

 

One snipped can be for always returing the last value of an context (execution type: value of contexts)

 

 

        if (contextValues != null && contextValues.length > 0) {

            String value = ResultList.SUPPRESS;

            for (int i = 0; i < contextValues.length; i++) {

                String str = contextValues[i];

                if (str != null && !ResultList.SUPPRESS.equalsIgnoreCase(str)) {

                    value = str;}}

            result.addValue(value);

        }

 

So it would look like this:

If TYPE = X, then Total2 = ((RATE/UNIT) * ( getLastContextValue{setContext higher(DEN/NUM)} )) * NUM

 

Kind regards

Konrad


Viewing all articles
Browse latest Browse all 2695

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>