Discussion Board for collaboration on QlikView Scripting.
I have a table with entry nos. which refer to a "from entry" and "to entry" numbers.
It looks like this:
I like to transform the data to get the result like follows (I had a look into "Generating missing data", but failed).
Attached is a sample qvw, it would be great if someone could assist me.
Go to Solution.
Thank you all for your help.
I solved it now, pls see attachment if of interest.
REQUIREMENT IS NOT CLEAR WHAT U WANT TO ACHIEVE ?
E.g. No. 99116 the values "From Entry No." and "To Entry No." are 1778073 and 1778084,
so I want to create the table for this No. as follows:
No. From Entry No. To Entry No.
99116 1778073 1778084 this is the original data, all following are to be created
99116 1778074 1778084
99116 1778075 1778084
99116 1778076 1778084
99116 1778077 1778084
99116 1778078 1778084
99116 1778079 1778084
99116 1778080 1778084
99116 1778081 1778084
99116 1778082 1778084
99116 1778083 1778084
99116 1778084 1778084
So in principle to create for each No. the field "From entry No." progressive until the value of "To entry No." is reached.
I still not clear what exact you want to achieve ?
I would use the ITERNO() function that starts at 1 and let you do a loop for each line of the table
sth like :
LOAD No, FromEntry + iterno() as FromEntry, ToEntry
WHILE FromEntry + iterno() <= ToEntry
This works perfect !
Thanks a lot.
try this code and see attachment
IterNo() as i,
([From entry No.]+IterNo()) as [From entry No new],
([From entry No.]+IterNo()) as [To entry No new]
No., From entry No., To entry No.
99116, 1778073, 1778084
99117, 1778085, 1778088
99118, 1778089, 1778092
] While ([From entry No.]+IterNo())<=[To entry No.];
Also a good solution.
How can I manage that the first From Entry No. keeps untouched ?
PFA for solution,
What do you mean with "untouched" ?
Iterno() starts at 1. You can do IterNo()-1 + xxx