Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a column in a table containing strings of list of values separated by commas (e.g. "val1, val2, val3").
I would like to import the single values as if in a separate, related table.
So I could select from a field "val1" or "val2".
Is this possible?
Do you want one ROW for every value in the list? If so, you can use the subfield() function:
LOAD
"Something"
,"Something Else"
,subfield("My Concatenated Field",',') as "My Field"
FROM...
;
use right, left or mid clauses, accord of the position in the column.
left(val1,2)
right(val3,3)
mid(val2,2,3)
Thank you Alfredo!
I'm sorry if I didn't explain well, but I can't. I don't know in advance the number of values, nor the number of them.
I could have a row "aaaa", another "bb, ccccc".
It really should be a 1-N relationship in the source db, but it isn't and I can't change that!
Thanks anyway for your fast response!
If you have any other thoughts, please let me know!
Do you want one ROW for every value in the list? If so, you can use the subfield() function:
LOAD
"Something"
,"Something Else"
,subfield("My Concatenated Field",',') as "My Field"
FROM...
;
That's it!
Thank you John, you're the best!