Hi,I have a field which is a multi-value data like:
“(BH)”
“(BH-BD)”
“(BP-EN-PR-OD)”
“(BP-AD-DC)”
“(BP-EP)”
“(TR-OD-PR-AA-DC)”,
Now I have a notes view which has two columns using this field data, I want a formula to loop each item of this multi-value field, after the formula looping, one of the column data should like this:
Sorry. My approach doesn’t work. Partly because in the data you gave you didn’t show any examples where there were more than 4 hyphens in one entry; but mostly because it just doesn’t work There may still be a non-looping way of doing it, but I have a plane to catch in a few hours. Will have to leave it to someone else to figure it out.
The idea is to first strip the parens, then pad all the strings so that they have at least 10 segments separated by hyphens. Then simultaneously remove the first two segments and reverse the order of the next eight. Then remove any segments that were added in the padding process, take the first and second segments (which are the last and second to last), re-assemble in the proper order, and then do some adjustments to get rid of hanging hyphens and empty parens.
Don’t ask me to completely explain the logic of the last line. I ran through this quickly, and for some reason that I don’t see, some of the ~ chars are surviving to that point even though I thought I had already gotten rid of them.
This will work for values that have up to 9 hyphens within the entries of the multi-value fields. If you need to deal with longer strings than that, you’ll need to either change the code appropriately, or maybe switch to a looping version.
Thank you so much for your help, especially in the Holiday season, the codes you sent to me are working very well, you save me a lot of time for this problem.