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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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
MVP
MVP

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
MVP
MVP

Awesome

I am glad I was able to help.

Best,

Sunny