Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table with entry nos. which refer to a "from entry" and "to entry" numbers.
It looks like this:
No. | From entry No. | To entry No. |
99116 | 1778073 | 1778084 |
99117 | 1778085 | 1778088 |
99118 | 1778089 | 1778092 |
I like to transform the data to get the result like follows (I had a look into "Generating missing data", but failed).
No. | From Entry No. | To Entry No. |
99116 | 1778073 | 1778084 |
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 |
99117 | 1778085 | 1778088 |
99117 | 1778086 | 1778088 |
99117 | 1778087 | 1778088 |
99117 | 1778088 | 1778088 |
99118 | 1778089 | 1778092 |
99118 | 1778090 | 1778092 |
99118 | 1778091 | 1778092 |
99118 | 1778092 | 1778092 |
Attached is a sample qvw, it would be great if someone could assist me.
Joerg
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 ?
VIKAS
Dear Vikash
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 ?
Hi Jörg,
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
From xxx
WHILE FromEntry + iterno() <= ToEntry
Fabrice
Dear Aunez
This works perfect !
Thanks a lot.
Joerg
hi
try this code and see attachment
LOAD *,
IterNo() as i,
([From entry No.]+IterNo()) as [From entry No new],
([From entry No.]+IterNo()) as [To entry No new]
Inline [
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 ?
No. | From entry No. | From entry No new | To entry No. | To entry No new |
99116 | 1778073 | 1778073 | 1778084 | 1778074 |
99116 | 1778073 | 1778074 | 1778084 | 1778074 |
99116 | 1778073 | 1778075 | 1778084 | 1778075 |
99116 | 1778073 | 1778076 | 1778084 | 1778076 |
99116 | 1778073 | 1778077 | 1778084 | 1778077 |
99116 | 1778073 | 1778078 | 1778084 | 1778078 |
99116 | 1778073 | 1778079 | 1778084 | 1778079 |
99116 | 1778073 | 1778080 | 1778084 | 1778080 |
99116 | 1778073 | 1778081 | 1778084 | 1778081 |
99116 | 1778073 | 1778082 | 1778084 | 1778082 |
99116 | 1778073 | 1778083 | 1778084 | 1778083 |
99116 | 1778073 | 1778084 | 1778084 | 1778084 |
Dear Jorg,
PFA for solution,
Regards
Kiran Rode
+91 8976977897
Hi,
What do you mean with "untouched" ?
Iterno() starts at 1. You can do IterNo()-1 + xxx
Fabrice