Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Splitting rows in Script

Hi,

I have an excel file which contains ID and other fields. ID contains multiple values in it. I need to separate each row based on ID.

Example:

ID         Value

1,2,3        100

4,5,6         200

7,8,9          300

Output:

ID           Value

1              100

2              100

3              100

4               200

5               200

6               200

7               300

8               300

9               300

Can any one tell me a way to achieve this.

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Try using the Subfield() function:

Table:

LOAD * Inline [

ID |        Value

1,2,3 |        100

4,5,6 |        200

7,8,9 |        300

] (delimiter is |);

NewTable:

NoConcatenate

LOAD SubField(ID, ',') as ID,

          Value

Resident Table;

DROP Table Table;


Update1: Forgot to add NoConcatenate

Update2: Sample Attached

View solution in original post

3 Replies
sunny_talwar

Try using the Subfield() function:

Table:

LOAD * Inline [

ID |        Value

1,2,3 |        100

4,5,6 |        200

7,8,9 |        300

] (delimiter is |);

NewTable:

NoConcatenate

LOAD SubField(ID, ',') as ID,

          Value

Resident Table;

DROP Table Table;


Update1: Forgot to add NoConcatenate

Update2: Sample Attached

Not applicable
Author

Thank you. It's working the way I need.

sunny_talwar

Awesome

I am glad I was able to help.

Best,

Sunny