How should it work? |
similar to CONVERT, but converts the values from a string context. Example. A field contains the text: 12.2" x 20" x 25" (or 12.2in x 20in x 25in)
Using a "convert string" would take the numbers and convert from the current unit of measure into a new one, but keep the characters around the individual values and it's unit intact. Technically, split by x, trim, check unit, convert value, and insert the value in the full sting again. Another approach would be to separate values in a spring and process each part separately, and then CONCATENATE then in the end
Example expression:
= CONVERTSTRING ('12.2in x 20in x 25in', 'in', 'm', 'x')
=CONVERT( SPLIT(FIELDVALUE("sourcefield"), 'x' )[0] , 'in','m')/1000
= CONCATENATE (CONVERT ( SPLIT(' 12.2in x 20in x 25in', ' x ') [0] , 'in', 'm')/1000, 'mm x ', CONVERT ( SPLIT(' 12.2in x 20in x 25in', ' x ') [1] , 'in', 'm')/1000, 'mm x ', CONVERT ( SPLIT(' 12.2in x 20in x 25in', ' x ') [2] , 'in', 'm')/1000),'mm')
Result: 31mm x 51mm x 64mm |