Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

giovanni16
New Contributor

Re: Add rows in table between start and enddate

Neetha,

Thank you for your reply.

However, it is not working. Your script creates records for each day in the month. I need 1 record per month for each row in the table. Max rows is the difference in number of months.

For example, for the first record, the difference between the start an the end date is 34 months, I need than 34 records. (The amount is the monthly amount)

For the second row, the difference is 36 months, thus 36 records

For thethird row, the difference is 36 months, thus again 36 records an so on...

But each new record need to have a new column with the first day of the month. 

See the post from Massimo.  That is what I want to achieve.

Re: Add rows in table between start and enddate

Giovanni

The IntervalMatch() function could be what you need. 

Have a look at this blog post IntervalMatch by Henric Cronström

Bill

neetha_p
Honored Contributor

Re: Add rows in table between start and enddate

So you want to generate dates(MMM/YYYY) and split dates monthly starting with day 1st of each as new column.

am i right?

Highlighted
rupaliqlik
Contributor

Re: Add rows in table between start and enddate


Use IterNo function to capture dates in between start date and end date

Temp:

load * inline

[

StartDate,EndDate

01/03/2015,31/12/2017

];

TEMP1:

load

StartDate,

EndDate,

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

resident Temp

While (StartDate+IterNo()-1)<=Date(EndDate);

Untitled.png

giovanni16
New Contributor

Re: Add rows in table between start and enddate

Massimo,

It seems the solution was in the filter.

Thank you very much for your help. It works now.

giovanni16
New Contributor

Re: Add rows in table between start and enddate

Neetha,

Yes that's correct.

Massimo found the solution. 

It was the use of a filter in the creation of records.

where

  day(month)=1;

Thanks for your help.