String manipulation subtracting the number of characters per cell content

Hi all,
I’m trying to create a formula using String Manipulation which subtracts the 2 or 1 characters from another column. The point is I’d like the numbers of characters to be subtracted to come from another column. Because the length of the cells differs in each row, I’m not able to to have a fixed number in the formula. Hope someone can help.

The substr function is expecting an integer for the 3rd argument. You’re giving it a string.

Is there a reason that the column holding the number of characters to be subtracted is not an integer?

Hi
That’s great! I just needed to change from String to Integer and it worked. Thank you

Just you know what I’m doing is separating month and year in different columns.
I was given a data that combines month and year in the following format: 123, 223, …, 1223
I need to separate the characters, and because some months the total amount of characters is 3 and others are 4, I cannot have a standard number to be subtracted.
The solution I was going with was to have a column to calculate the number of characters, and then using that column as a source for the substr function.

Hi @DiegoCorreiaXTL ,

Just a little tip for others here… You can extract year, month, day, week and more with Date&Time Extract node. It can help you create another columns if you need for this propous.

1 Like

Great tip @denisfi
Appreciate it. Thank you

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