Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
villafuerte
Partner Ambassador
Partner Ambassador

Generate fields between 2 numbers

Hi,

I'm trying to create new fields from start and end values in a table. All the values I need are there, so I'm not shure if Interval Match is the solution. It's something like this:

Start End Quota

1 3 555

4 7 888

8 9 333

And I want to create something like this:

Time Quota

1 555

2 555

3 555

4 888

5 888

6 888

7 888

8 333

9 333

Thanks



1 Solution

Accepted Solutions
pover
Luminary Alumni
Luminary Alumni

Villafuerte,

Do something like this:

Original_Table:
LOAD * INLINE [
Start,End,Quota
1,3,555,
4,7,888
8,9,333
];


Table:
Load iterno() as Iterno,
Start + iterno()-1 as Time,
Quota
resident Original_Table
while iterno() <= End-Start+1;

Drop table Original_Table;

Regards.

View solution in original post

3 Replies
Not applicable

Did you try with the subfield function ?

Subfield can duplicate records but I'have not tested your very interesting issue.

JJ

pover
Luminary Alumni
Luminary Alumni

Villafuerte,

Do something like this:

Original_Table:
LOAD * INLINE [
Start,End,Quota
1,3,555,
4,7,888
8,9,333
];


Table:
Load iterno() as Iterno,
Start + iterno()-1 as Time,
Quota
resident Original_Table
while iterno() <= End-Start+1;

Drop table Original_Table;

Regards.

villafuerte
Partner Ambassador
Partner Ambassador
Author

Thanks Karl!