I have a field where the data output looks like this:
DESCRIPTION
RW/MS/SCRAP/BOSTON
I need to separate each value between the forward slashes into its own field like this:
DESC1 DESC2 DESC3 DESC4
RW MS SCRAP BOSTON
I found the following formula online and placed it in DESC1. It works great.
If not Isnull({INVENTORY_TRANS.DESCRIPTION}) then
If Instr({INVENTORY_TRANS.DESCRIPTION}, "/") >1 Then Mid({INVENTORY_TRANS.DESCRIPTION} , 1, (INSTR({INVENTORY_TRANS.DESCRIPTION} , "/")-1)) else { INVENTORY_TRANS.DESCRIPTION}
However, if I replicate the formula and place it in DESC2, DESC3 & DESC4, making what I thought were the necessary adjustments, it doesn't work.
Here is how I adjusted them (which I am sure I am TOTALLY off the mark!):
DESC2
If not Isnull({INVENTORY_TRANS.DESCRIPTION}) then
If Instr({INVENTORY_TRANS.DESCRIPTION}, "/") >2 Then Mid({INVENTORY_TRANS.DESCRIPTION} , 2, (INSTR({INVENTORY_TRANS.DESCRIPTION} , "/")-2)) else { INVENTORY_TRANS.DESCRIPTION}
DESC3
If not Isnull({INVENTORY_TRANS.DESCRIPTION}) then
If Instr({INVENTORY_TRANS.DESCRIPTION}, "/") >3 Then Mid({INVENTORY_TRANS.DESCRIPTION} , 3, (INSTR({INVENTORY_TRANS.DESCRIPTION} , "/")-3)) else { INVENTORY_TRANS.DESCRIPTION}
DESC4
If not Isnull({INVENTORY_TRANS.DESCRIPTION}) then
If Instr({INVENTORY_TRANS.DESCRIPTION}, "/") >4 Then Mid({INVENTORY_TRANS.DESCRIPTION} , 4, (INSTR({INVENTORY_TRANS.DESCRIPTION} , "/")-4)) else { INVENTORY_TRANS.DESCRIPTION}
Can someone please help me with the needed adjustments?
Much appreciated!
|
Sometimes only 3, but I have placeholders (fields: DESC1, DESC2, DESC3, DESC4) for up to 4 values.
Like I mentioned above, I found a formula online which I used. It handles the value before the first "/" just fine, but I can't get it to work past that since I don't truly understand the formula. I do not know how to adjust the variables correctly (see above where I simply adjusted the numbers in the formula to reflect 1, 2, 3 and 4...which I clearly isn't accurate).
|