IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Sum() function is not working inside if() function

    Posted 03/01/18 06:44 AM

    Originally posted by: tverma


    Individual_Adjustment_Previous ADX(s): Group
    --ADX Segment: Group
    ----M'Amt:Field
    ----Adj'tReasonCd Element:Field

    Using the above "Tree", I am doing sum of all ADX Amount's by rule "=SUM(M'Amt Element:ADX Segment:Individual_Adjustment_Previous ADX:In1)", but in case if ADX segment doesn't exist in input file, then it is generating 0. However, my requirement is to suppress 0 and put space.

    I tried to use Sum() function inside if() function by rule "=IF(PRESENT(Individual_Adjustment_Previous ADX:In1), SUM(M'Amt Element:ADX Segment:Individual_Adjustment_Previous ADX:In1))". It is not generating 0 as expected if ADX segment doesn't exist in input file, but Sum() stopped working if ADX segments are present.

    Any help would be appreciated to suppress 0 along with sum. 


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: Sum() function is not working inside if() function

    Posted 03/02/18 04:18 AM
      |   view attached

    Originally posted by: PaulBrett


    I think you're hitting an issue called Series Consuming Functions.

    Examine the enclosed testcase.

    Test1 will give the correct answer

    Test2 will give the wrong answer (when the test for 0 is done).  This is because the IF() has already consumed the series before the SUM() can get to it.

    Test3 shows how to avoid the issue.  You do the SUM(), but drop the result into a functional map to do the IF().

    Thank you.

    Paul

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender

    Attachment(s)

    zip
    SCF.zip   10 KB 1 version


  • 3.  Re: Sum() function is not working inside if() function

    Posted 03/05/18 08:13 AM

    Originally posted by: tverma


    It worked fine. Thanks for your response!


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender