SSIS EXPRESSION HELP NEEDED WITH SYNTAX - HOW TO REPLACE A VALUE IN A STRING

  • Team:
    Please look at the attached. So the file name ( in the expression output )  has  a part that says XXX.  What i want is to replace the XXX with the value in the variable LINE_OF_BUSINESS
    As simple as that .. But I am not sure I know how to work out the syntax.

  • mw_sql_developer - Wednesday, September 5, 2018 11:31 AM

    Team:
    Please look at the attached. So the file name ( in the expression output )  has  a part that says XXX.  What i want is to replace the XXX with the value in the variable LINE_OF_BUSINESS
    As simple as that .. But I am not sure I know how to work out the syntax.

    Use the REPLACE function to do this work:  (look in the upper right pane and open the folder labeled "String Functions")
    Something like this should work...
    REPLACE((@[$Project::ACG_OUTPUT_FILE_PATH] + @[$Project::ACG_OUTPUT_FILE_MEMBER_ACG), "XXX", @[$USER::LINE_OF_BUSINESS] )
    Don't forget to press the Evaluate Expression button to ensure you get a proper value.  If you get an error or invalid output I may have some parameters backwards or not spelled correctly.

  • Smendle - Wednesday, September 5, 2018 11:45 AM

    mw_sql_developer - Wednesday, September 5, 2018 11:31 AM

    Team:
    Please look at the attached. So the file name ( in the expression output )  has  a part that says XXX.  What i want is to replace the XXX with the value in the variable LINE_OF_BUSINESS
    As simple as that .. But I am not sure I know how to work out the syntax.

    Use the REPLACE function to do this work:  (look in the upper right pane and open the folder labeled "String Functions")
    Something like this should work...
    REPLACE((@[$Project::ACG_OUTPUT_FILE_PATH] + @[$Project::ACG_OUTPUT_FILE_MEMBER_ACG), "XXX", @[$USER::LINE_OF_BUSINESS] )
    Don't forget to press the Evaluate Expression button to ensure you get a proper value.  If you get an error or invalid output I may have some parameters backwards or not spelled correctly.

    Thx, I managed to figure out in the mean time 


    @[$Project::ACG_OUTPUT_FILE_PATH]  + REPLACE( @[$Project::ACG_OUTPUT_FILE_MEMBER_ACG] , "XXX", @[User::LINE_OF_BUSINESS] )

    works!  Thanx anyway

Viewing 3 posts - 1 through 2 (of 2 total)

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