Need ssis expression

  • Here is the agebucket column: 12-24

    need lowerbound :12 and upperbound:24

    Right now I wrote expression in tsql something like below:

    Substring([AgeBucket],0,CharIndex('-', [AgeBucket])) As LowerBound

    ,LTRIM(REPLACE(Substring([AgeBucket],CharIndex('-', [AgeBucket]),3),'-','')) As UpperBound

    How can we re-write as SSIS expression ?

  • komal145 (6/10/2016)


    Here is the agebucket column: 12-24

    need lowerbound :12 and upperbound:24

    Right now I wrote expression in tsql something like below:

    Substring([AgeBucket],0,CharIndex('-', [AgeBucket])) As LowerBound

    ,LTRIM(REPLACE(Substring([AgeBucket],CharIndex('-', [AgeBucket]),3),'-','')) As UpperBound

    How can we re-write as SSIS expression ?

    TOKEN( "12-24","-",1 )

    TOKEN( "12-24","-",2 )

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • thing is agebucket column has "(other)" as value and "65+" this is not working:(

    how to check if this values exists just palce this value in the column?

  • Use the conditional.

    TOKEN( @[User::AgeBucket],"-",1) == @[User::AgeBucket] ? TOKEN( @[User::AgeBucket],"+",1) : TOKEN( @[User::AgeBucket],"-",1)

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • komal145 (6/10/2016)


    thing is agebucket column has "(other)" as value and "65+" this is not working:(

    how to check if this values exists just palce this value in the column?

    This is important information. Had you included it in your initial post, I would have provided a different answer.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply