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.  extracting earliest date from multiple series

    Posted 09/11/07 12:37 PM

    Originally posted by: SystemAdmin


    Hi there

    This is difficult to explain but here goes.... I am trying to take date and time fields from 3 different series and to output the earliest date out of all dates, I have tried to explain how the input data is.

    01(1:1) ExpirationDate|ExpirationTime
    02(1:S) ExpirationDate|ExpirationTime|MarketDeadlineDate|MarketDealineTime
    01|20070911|172415
    02|20070911|172412|20070911|172413
    02|20070911|172414|20070911|172411

    Below is what I am trying to do but this doesn't work as the first MIN function cannot take multiple series? Any ideas how to do this?

    =MIN(TODATETIME(Expiration Date Field:01+Expiration Time Field:01),MIN(TODATETIME(Expiration Date Field:02+Expiration Time Field:02)), MIN(TODATETIME(MarketDeadline Date Field:02+MarketDeadline Time Field:Payout Record:Announcement)))))
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: extracting earliest date from multiple series

    Posted 09/11/07 01:26 PM

    Originally posted by: john.gibby


    I haven't tested it, but I think you may have to do something like this:

    code=EITHER(
    IF(
    MIN(TODATETIME(Expiration Date Field:01+Expiration Time Field:01))
    <= MIN(TODATETIME(Expiration Date Field:02+Expiration Time Field:02))
    &
    MIN(TODATETIME(Expiration Date Field:01+Expiration Time Field:01))
    <= MIN(TODATETIME(MarketDeadline Date Field:02+MarketDeadline Time Field:Payout Record:Announcement))
    ,MIN(TODATETIME(Expiration Date Field:01+Expiration Time Field:01))
    )
    ,IF(
    MIN(TODATETIME(Expiration Date Field:02+Expiration Time Field:02))
    <= MIN(TODATETIME(Expiration Date Field:01+Expiration Time Field:01))
    &
    MIN(TODATETIME(Expiration Date Field:02+Expiration Time Field:02))
    <= MIN(TODATETIME(MarketDeadline Date Field:02+MarketDeadline Time Field:Payout Record:Announcement))
    ,MIN(TODATETIME(Expiration Date Field:02+Expiration Time Field:02))
    )
    ,MIN(TODATETIME(MarketDeadline Date Field:02+MarketDeadline Time Field:Payout Record:Announcement))
    )[/code]

    This will compare the minimum value from each of the series to determine which is the [i]MIN of the MINs[/i].

    Yeah, I wish there were a TEXTTOSERIES function to complement SERIESTOTEXT. I'm sure someone has requested it...I'm not holding my breath.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: extracting earliest date from multiple series

    Posted 09/12/07 09:03 AM

    Originally posted by: DianeC


    If you set up your input type tree to treat record 2 as though it has a repeating group of 2 fields, then you just need to do a min on the group.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: extracting earliest date from multiple series

    Posted 09/13/07 05:24 AM

    Originally posted by: SystemAdmin


    Hi Diane

    Not sure I understand what you are saying, can you please expand?
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: extracting earliest date from multiple series

    Posted 09/13/07 06:42 AM

    Originally posted by: DianeC


    In your tree, define the record as having the first field (where the '2' is) and a group, that group having 2 fields - date & time. The properties of the record should include a (infix) delimiter of '|'. Roughly:

    RecordGroup (delimited by literal "|")
    contains field1 (1:1) text field
    (and) DTgroup (1:s) contains date field
    time field
    Then, in your map when you get to the point you will need to map the DTgroup, you can say:
    = MIN(DTgroup) ....that'll get you the min of the date fields. If you want the min function to include the first field, then MIN(RecordGroup).
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender