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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
yashcena
Contributor III
Contributor III

Need to break down a column into rows with iterative script

Hi,

I have the following data in my data model:

yashcena_0-1649324882730.png

I need to break up the ORDERED_PRODUCTS column into rows like this:

yashcena_1-1649324925695.png

I can use subfield function to extract each of  "RecurringDue", "ProdQuantity", "ProdName", "ProdDesc" etc.

But the problem is 1st ID has 3 products, 2nd ID has 2 products and 3rd ID has 4 products. I'm not able to figure out how to write the script so that it first checks how many {.....}, {......}, {.....} are there in each row and then use "subfield" that many times.

So for 1st row, we have three {....} - need to use subfield 3 times
2nd row, we have two {...} - need to use subfield 2 times....so on and so forth.

Any help would be greatly appreciated.

@sunny_talwar 

Labels (2)
1 Solution

Accepted Solutions
marcus_sommer

You don't need to know how many parts are there. You could use subfield() just with two parameters and it will creates all appropriate records. 

- Marcus

View solution in original post

1 Reply
marcus_sommer

You don't need to know how many parts are there. You could use subfield() just with two parameters and it will creates all appropriate records. 

- Marcus