Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Gurus,
Just some scripting wisdom is in need, if I have a record as follows.
Orderno | StartDate | Duration |
---|---|---|
123456 | 11/11/2016 | 5 |
If I want to repeat this record depending on the Duration number i.e 5 how would I do that.
So my resulting data set should be
Orderno | Date |
---|---|
123456 | 11/11/2016 |
123456 | 12/11/2016 |
123456 | 13/11/2016 |
123456 | 14/11/2016 |
123456 | 15/11/2016 |
Try like:
LOAD
Date(StartDate + IterNo()-1) as Date,
Orderno
FROM
[https://community.qlik.com/thread/240200](html, codepage is 1252, embedded labels, table is @1)
while IterNo() <= Duration;
Something like this:
LOAD
OrderNo,
Date(StartDate + IterNo()) - 1 as Date
FROM
WhereWhile IterNo() < Duration;
Try like:
LOAD
Date(StartDate + IterNo()-1) as Date,
Orderno
FROM
[https://community.qlik.com/thread/240200](html, codepage is 1252, embedded labels, table is @1)
while IterNo() <= Duration;
Thanks for the prompt response,
But the "From" part does not seem clear enough, Is it supposed to be autogenerate or the same table . If it is the same table as
Orderno | StartDate | Duration |
---|---|---|
123456 | 11/11/2016 | 5 |
Then this will be producing only 1 row. How will it create 5 rows.
Yes the While clause does the trick.
Thanks a million