Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Autogenerate dates in a certain range

Hello! I have data in the format of the table below:

start_datecompany_namepay_model
2015-10-01Company11
2015-12-01Company21
2016-01-01Company32
2015-12-01Company46

I want to expand the table to showing dates up to 2016-01-01 for each company:

start_datecompany_namepay_model
2015-10-01Company1

1

2015-11-01Company1

1

2015-12-01Company11
2016-01-01Company11
2015-12-01Company21
2016-01-01Company21
2016-01-01Company32
2015-12-01Company4

6

2016-01-01Company46

So far, i've auto generated the dates but all my solutions gives each company_name the same time span, Company1 spans from 2015-10-01 to 2016-01-01 (which is correct) but so does also the other companies.

Any suggestions on how this can be achieved?

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Autogenerate dates in a certain range

Try something like

SET DateFormat = 'YYYY-MM-DD';

LOAD Date(Addmonths(start_date,iterno()-1)) as start_date, company_name, pay_model

FROM ....

WHILE AddMonths(start_date,iterno()-1) <= makedate(2016,1);

2 Replies
MVP
MVP

Re: Autogenerate dates in a certain range

Try something like

SET DateFormat = 'YYYY-MM-DD';

LOAD Date(Addmonths(start_date,iterno()-1)) as start_date, company_name, pay_model

FROM ....

WHILE AddMonths(start_date,iterno()-1) <= makedate(2016,1);

Not applicable

Re: Autogenerate dates in a certain range

That worked exactly as I wanted it to! Thank you so much for shortening my evening working session