Removing Financial Year

Hi KNIME Experts & Enthusiastic!!
Trust you are safe.

I am having following problem while working on my workflow.

Input:

Fin Year Invoice no.
19-20 AM/19-20/24789
19-20 AM/19-20/24790
18-19 ASD/7458/18-19
20-21 7891245/20-21

Requirement:

Want to remove financial year from Invoice no., but it can be any year not specific for 2018-19 or 2019-20 or 2020-21.

Output:

Fin Year Invoice no.
19-20 AM//24789
19-20 AM//24790
18-19 ASD/7458/
20-21 7891245/

I have tried using table row variable & string manipulation, but i am not getting desired result.

Thanks in advance.
Ravi

Hi @ravi13 , there are a number of ways it can be done, but the following in String Manipulation should do it if you wish to leave the “/” characters untouched as per your sample output

replace($Invoice No$,$Fin Year$ ,"" )

image

image

If you don’t want the // in the middle or the trailing / either, then with your sample data the following would work.
replace($Invoice No$,"/"+$Fin Year$ ,"" )
or, if the financial year could also appear at the start, and you wanted to lose the / with it, you could nest two variations:
replace( replace( $Invoice No$,"/"+$Fin Year$ ,"" ) ,$Fin Year$+"/","")

5 Likes

Hi @takbb ,
thanks for solution

3 Likes

@takbb already provided you the right solution (great work)
Just in case you don’t have the first column as reference then you could go with a regex in string manipulation
11

12
best regards

4 Likes

Hi @Daniel_Weikert ,
Thanks for attention. I will definitely consider this solution for future workflow.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.