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.  How to write IF-ELSE-IF

    Posted 03/13/18 03:32 AM

    Originally posted by: johnxp


    Hi anyone can help?

    I want to do some conversion based on line number, 1st line(header), get 10 chars, last line(footer), get 30 chars, the rest(detail), get 120 chars.

    My function is like:

    =F_ModifyData(Data Field:Input, INDEX(Data Field:Input), COUNT(Data Field:Input))

    my rule in the function:

    =IF (In2 = 1, MID(In1, 1, 10), IF (In2 = In3, MID(In1, 1, 30), MID(In1, 1, 120)))

    However, I always get 30 for the last line.

    Appreciate your help.

     


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


  • 2.  Re: How to write IF-ELSE-IF

    Posted 03/13/18 05:35 AM

    Originally posted by: johnxp


    I found the root cause, looks like the COUNT() function return 1,2,3,,, the same value as INDEX(). how come?

     


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


  • 3.  Re: How to write IF-ELSE-IF

    Posted 03/13/18 05:59 AM
      |   view attached

    Originally posted by: PaulBrett


    I think you're running into problems with Series Consuming Functions again.

    Check out the enclosed example file.  Test1 shows 'odd' results along the same lines you're seeing.  Test2 shows one way to deal with it.  Don't try to use more than one function on a Series object in the same rule.

    Thank you.

    Paul

    Follow me on Twitter


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

    Attachment(s)

    zip
    SCF_Index_Count.zip   3 KB 1 version


  • 4.  Re: How to write IF-ELSE-IF

    Posted 03/13/18 06:23 AM

    Originally posted by: johnxp


    Great examples and advice! Thank you.


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