Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Partner
Partner

Creating Rows problem

Hi Gurus,

Just some scripting wisdom is in need, if I have a record as follows.

OrdernoStartDateDuration
12345611/11/20165

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

OrdernoDate
12345611/11/2016
12345612/11/2016
12345613/11/2016
12345614/11/2016
12345615/11/2016
1 Solution

Accepted Solutions
MVP
MVP

Re: Creating Rows problem

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;


Capture.PNG

View solution in original post

4 Replies
MVP
MVP

Re: Creating Rows problem

Something like this:

LOAD

  OrderNo,

  Date(StartDate + IterNo()) - 1 as Date

FROM

WhereWhile IterNo() < Duration;

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

Re: Creating Rows problem

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;


Capture.PNG

View solution in original post

Partner
Partner

Re: Creating Rows problem

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

OrdernoStartDateDuration
12345611/11/20165

Then this will be producing only 1 row. How will it create 5 rows.

Partner
Partner

Re: Creating Rows problem

Yes the While clause does the trick.

Thanks a million