Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
bismart
Creator
Creator

Explode Summary table to detail table

Hi

I have a summary table as follows;

Product CategoryASPUnitsRows
Category A120.0013893
Category B26.677034
Category C191.257842

I want to explode the table to a new table with number of rows for each Product Category as defined in the Rows column.

Required:

Product CategoryCodeASPUnits
Category A1120.001389
Category A2120.001389
Category A3120.001389
Category B426.67703
Category B526.67703
Category B626.67703
Category B726.67703
Category C8191.25784
Category C9191.25784

Category A has 3 rows.. Category B as 4 etc.

In the new detailed table I also want to create a new field (Code) which can be any sequential number series.

Anybody any ideas how to achieve this?

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like this:

LOAD *, iterno() as Code INLINE [

Product Category,    ASP,    Units,    Rows

Category A,    120.00,    1389,    3

Category B,    26.67,    703,    4

Category C,    191.25,    784,    2

] while iterno() <= Rows;

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe like this:

LOAD *, iterno() as Code INLINE [

Product Category,    ASP,    Units,    Rows

Category A,    120.00,    1389,    3

Category B,    26.67,    703,    4

Category C,    191.25,    784,    2

] while iterno() <= Rows;

bismart
Creator
Creator
Author

Thanks for that

Works a treat