Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a data set that looks like similar to this
Request Response
CR-1 F1,F2,F3,F4
CR-2 F5
CR-3 F6, F7
CR-4 F8 F9
CR-5 F10/F11
I want it to look like a row for each response
Request Response
CR-1 F1
CR-1 F2
CR-1 F3
CR-1 F4
CR-2 F5
etc ...
I can handle the various delimiters and cases where the response data is not of the correct format (I hate free form entry fields!!), but I'm not sure how to expand single rows into multiple rows in the load statement.
Suggestions?
Just use SubField() for your preceding load or please tell me the output for sample set
Source:
load * inline [
Request | Response
CR-1 | F1,F2,F3,F4
CR-2 | F5
CR-3 | F6, F7
CR-4 | F8 F9
CR-5 | F10/F11
] (delimiter is '|')
;
Final:
load
Request,
//Response,
SubField(Replace(Replace(Replace(trim(Response), ' ', ','), '/', ','), ',,', ','), ',') as ResponseNew
Resident Source;
DROP Table Source;
Try this?
= Subfield(Subfield(Subfield(Trim(Response), ','),' '), '/')
OOps missed the space thing. Using Massimo's replace you can also write something like this:
= Subfield(Subfield(Subfield(Replace(Response,', ',','), ','), ' '), '/')