Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create rows in a script

Hi There

I am currently using the script below to populate dates between a slowly changing dimension to determine whether a container is hired out or available.

Temp2:

load *, if(previous(Unit)=Unit, previous([Movement Date]),[Movement Date]+1) as NextDate

Resident Movement

order by Unit, [Movement Date] desc;

drop table Movement;

Result:

load Unit, date([Movement Date] + IterNo() -1) as [Movement Date],  [Available/On-Hire]

Resident Temp2

while [Movement Date] + IterNo() - 1 < NextDate

order by Unit, [Movement Date];

This has successfully created a row for each date between the first movement date and the last movement date. However I now need to create rows between the last movement date up until today's date.

If anybody has any ideas or advice on how to do this then it would be much appreciated.

Kind Regards,

Steven

2 Replies
Clever_Anjos
Employee
Employee

Concatenate a record to your Temp2 table before loading result

concatenate(Temp2)

LOAD

    today() as NextDate

autogenerate 1;

hic
Former Employee
Former Employee