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.  Convert to Decimal , Right Justified

    Posted 06/24/19 03:13 PM

    Originally posted by: NICK_R


    Hi Team,

     

    I am stuck with a decimal conversion while I was doing some maps as part of the migration project.

    We have a different scenario that needs to be achieved through the wtx mapping .

     

    Scenario 1 :need to convert the highlighted number to decimal format on the Right side. Convert to 2 decimal point, right justified & zero filled if no data available. It has a Leading +

    SETT//82345,04

    X(20) is the data size.

    +0000000000082345.04

     

     


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


  • 2.  Re: Convert to Decimal , Right Justified

    Posted 06/25/19 05:22 AM
      |   view attached

    Originally posted by: PaulBrett


    Here's a couple of ways to do it in the attached example.

    One uses the Typetree definitions, the second assumes all fields are text, and uses rules to achieve the same result.

    Thank you.

    Paul

    Follow me on Twitter


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

    Attachment(s)

    zip
    NumConv.zip   3 KB 1 version


  • 3.  Re: Convert to Decimal , Right Justified

    Posted 06/25/19 06:26 PM

    Originally posted by: NICK_R


     PaulBrett @ PaulBrett

     

    Paul, I was actually looking for the Test2 solution from the provided example. I was able to change the logic slightly according to my needs. How ever the Logic in the example is not punching the decimal as per my requirement. 

     

    Changed the Logic to :  = IF (TONUMBER(In1,"{####'.'2##2}")<=0,"+","+")+FILLLEFT(TEXT(TONUMBER(In1,"{####'.'2##2}")),"0",15)

     

    Input value :  12345,04     or 00000,00

    Required Output :    +000000012345.04      or    +000000000000.00

     

    -- >  With in my code base I am able to get output as +000000000000000

     


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


  • 4.  Re: Convert to Decimal , Right Justified

    Posted 07/01/19 11:33 PM

    Originally posted by: NICK_R


    PaulBrett @ PaulBrett ,

     

    Can you please help with the TEST 2 solution since that was not complete. I tried to change logic to convert this to the 2 decimal point , but did not had much luck.

    Changed the Logic to :  = IF (TONUMBER(In1,"{####'.'2##2}")<=0,"+","+")+FILLLEFT(TEXT(TONUMBER(In1,"{####'.'2##2}")),"0",15)    

     

    Input value :  12345,04     or 00000,00

    Required Output :    +000000012345.04      or    +000000000000.00

     

    -- >  With in my code base I am able to get output as +000000000000000


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


  • 5.  Re: Convert to Decimal , Right Justified

    Posted 07/05/19 03:29 AM

    Originally posted by: PaulBrett


    I didn't see that the input had a comma delimiter and your output required a decimal:

    =IF(TONUMBER(In1,"{####'.'2##2}")<0,"-","+")+FILLLEFT(TEXT(TONUMBER(SUBSTITUTE(In1,",","."),"{####'.'2##2}")),"0",19)

    Thank you.

    Paul

    Follow me on Twitter


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


  • 6.  Re: Convert to Decimal , Right Justified

    Posted 07/10/19 11:49 PM

    Originally posted by: NICK_R


    Tried this logic PaulBrett50DK7Q2WB6, but I am getting error : Argument #1 for function SUBSTITUTE is invalid.

     

    =IF(TONUMBER(In1,"{####'.'2##2}")<0,"-","+")+FILLLEFT(TEXT(TONUMBER(SUBSTITUTE(In1,",","."),"{####'.'2##2}")),"0",19)

    Input value :  12345,04     or 00000,00

    Required Output :    +000000012345.04      or    +000000000000.00


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


  • 7.  Re: Convert to Decimal , Right Justified

    Posted 07/11/19 04:11 AM
      |   view attached

    Originally posted by: PaulBrett


    Works for me.  This map assumes your In1 object is TEXT.

    Thank you.

    Paul

    Follow me on Twitter


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

    Attachment(s)

    zip
    NumConvComma.zip   3 KB 1 version