How can I define formula to import the right srting after the last "_"?
Thaks in advance!
Do you need the formula to be in a table ? I can offer the following solution that works :
dt = Current Data Table(); // Ensure your data table is open and it is current Vals = :Column 1 << Get Values; // Get Values out Res = List(); // Define empty list for(i = 1 , i <= N Items(Vals), i++, Test = Words(Vals[i],"_"); // Words is the function that will split your string by delimiter Insert Into(Res,Test[N Items(Test)]); ); Show(Res);
You could use a similar approach to parse out the strings separated by the delimiter in a column formula as well, by using the following as a column formula:
Words(:Column 1, "_")
But then, I can't really think of a way to get the last string out in the column formula. Hope this helps some. Maybe look at "Substr" function - it might help
Similarly, you could use the Word function to get the last "word" using an index of -1 (i.e. count backwards from the end). This just saves you from needing any JSL variables/lists.
Word( -1, :Column 1, "_");
There are no labels assigned to this post.