Issues using replace function

Marco_13112001
edited August 6 in General

Good Afternoon,

I'm using the below function to replace values in one column with another value that I've stored in a variable(all the columns are within the same dataset), and I'm able to change only one row. Is there anything I'm missing here?

Many thanks in anticipation.

Best regards,

Marco

Answers

  • Josh Boxer
    Josh Boxer Administrator

    Doesnt look to be an issue with Replace. Your Parse by Regex Function is returning blank in YM column for all but row 5.

    Use a Parameter to test inputs other than 0 and different Lot No that should meet your Regex criteria

  • @Josh Boxer Sorry but I'm not sure about your proposed solution. The problem is not the parser as I'm able to get the value and store it as a variable. The issue is when I add the replace function and it just replaces the the value on the 5 row as you point out.

  • Josh Boxer
    Josh Boxer Administrator

    The values being parsed in rows 1,2,3&4 are blank/null, shown in the YM variable column, so these blanks are replacing the zero in these rows. Maybe I am missing something or you have some further examples you are looking at.

  • @Josh Boxer I can see your point now. The original idea was to extract the value matching the REGEX format from the column Lot No. and then use it to replace all the values on the Year/month column. Do you have any suggestions on how it can be achieved?

  • Josh Boxer
    Josh Boxer Administrator

    I am assuming your Regex is not correct, but maybe remove the Replace and show the results and share the Regex you are using.

  • Marco_13112001
    edited August 7

    @Josh Boxer this is the result of the Parse and the Regex used - ^\d{4}_(0[1-9]|1[0-2])$