For the 10 shelf positions you could have used 10 text boxes, this is the simplest method.
The use of a comma delimited string within a single text box saves space on the option dialog. This requires the use of the find formula, you will note that the FIND formula produces an error if it cannot find what its searching for.
Coding is done bit by bit. Errors must be circumnavigated as there are no error trapping methods in DCs, (like if error do this.. does not exist)
The work around is to add what you are looking for to the end of the string you are searching,
https://sketchucation.com/forums/viewtopic.php?f=289&t=67899
In the shelf example, I added ten commas, so that if one just put one value in the string, each FIND needs to return a value other than the -1 (error).... Attributes: p1 to p_10
So, each FIND returns the position of the comma in the string, the MID function isolates bits of text based on the count of each symbol. MID( string, position of comma +1, length which is the next comma, minus the previous -1 ) however if length equals zero then another error, so changed the added ten commas to “0,0,0,0,0,0,0,0,0,0,” .... Attributes: s1 to s_10
Now need a further check to see if the string has a comma (or delimiter of your choice) at the end, otherwise we would get another zero length in the MID formula We use the difference between the length of string and position of the last comma of the string with a comma attached. Which return 0 (false) if there is a comma in the original string or 1 (true) if not..... Attributes: check
This is certainly a bit of a mind game, but hopefully after a few or more reads it makes sense
Another clever trick is to the use of the CURRENT formula to match the copies with the positions, this saves a lot of either nested IF statements or writing out a CHOOSE statement
Z =current("pos" & copy+1)
The summation in pos (position of shelf) has a thickness of 20mm, you could have this as an attribute if required
Copies is based on whether the S values are not zero, true if so. (a return of zero is evaluated as false, whereas any other value is true)