ssisssis-2016

SSIS Expression Builder - How to find last occurrence of a character


I have values that look like this:

D:\DM-250\Insert_Jobs-QA-UAT\14-FILE_A_UpdateInsert.dts

D:\DM-250\Insert_Jobs-QA-UAT\Something_DaisyChain\14-stuff_and_things_UpdateInsert.dts

D:\DM-250\14-another_file.dts

I want the very ends of these 3 values, starting from the last "\" character.

I tried to use FINDSTRING, but I don't know how to grab the last occurrence of a character.

Any suggestions?


Solution

  • This will give you the position from the right.

    findstring(reverse([your column]),"\",1)
    

    I am guessing you are trying to extract filename which is:

    right([your column], [result from above] - 1)