Hi @CarishmaM , if the length of the string varies, then you have to rely on the length() function as @ipazin suggested.
However, you mentioned that you are dealing with a column of 12 digit numbers. Are they always 12 digit? If that is the case, then your requirement can be rephrased to you want to keep the first 6 digits, which can be done simply by: substr($columnname$, 0, 6)
Hi @ipazin , you did not make a mistake. Your suggestion for length() actually is answering the request, which is to remove the last 6 digits, and might still be the solution to use if the column is not consistent with 12 digits. My solution works only if the column always has 12 digits.
I also tried that solution. However, I still receive an error message for Line 65 and Line 66. All of the cells in the column are 12 digits.However, I am not sure if the fact that Knime is reading the numbers as 2,222,222,222…
Your regex is currently not recognized correctly
(Interesting I posted it with double backlash but that does only show \ so I need to post 3 backslashes to show 2 in the post ?)
Hi @CarishmaM , the substr works only with string columns, but your MTN column is a Double column, so you can cast your column to string in your manipulation, like this: substr(string($MTN$), 0, 6)
or substr(string($MTN$), 0, length(string($MTN$)) - 6)
Similarly for the regex that you are trying from @Daniel_Weikert 's suggestion, this would work on a string column only, so you have to cast your column to string there too if you want to use regex.
Sure @CarishmaM , when you look at the columns that you have, you notice that there is an icon in front of them:
That icon indicates the type of the column. For example:
[S] for String
[I] for Integer
[B] for Boolean
[D] for Double. Double is simply a type that can hold a number with decimal.
For example, 40 is an Integer and 40.0 or 40.00 is a Double.