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



Labels (1)
1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

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
Partner - Master
Partner - Master

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!