Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can LOAD statement ends with AUTOGENERATES function

DateIsland:
LOAD
date($(vMinDate) + rowno() - 1) AS D,
year($(vMinDate) + rowno() - 1) AS Y,
month($(vMinDate) + rowno() - 1) AS M,
date(monthstart($(vMinDate) + rowno() - 1), 'MMM-YYYY') AS MY
AUTOGENERATE
vMaxDate - vMinDate + 1;

7 Replies
spsrk_84
Creator III
Creator III

Hi,

YEs the load statement can end with autogenerate statements..

ex:

Load RecNo( ) as A, rand( ) as B autogenerate(10000);

One thing i didnot understand what was the actual problem in script.

Regards

Ajay

Not applicable
Author

Sintex error while compiling script.

Missing FROM

Not applicable
Author

is something wrong in script????

spsrk_84
Creator III
Creator III

Let vMinDate='01/01/2010';
LET vMaxDate=Date(Today(),'DD/MM/YYYY');



DateIsland:
LOAD
date($(vMinDate) + rowno() - 1) AS D,
year($(vMinDate) + rowno() - 1) AS Y,
month($(vMinDate) + rowno() - 1) AS M,
date(monthstart($(vMinDate) + rowno() - 1), 'MMM-YYYY') AS MY
AUTOGENERATE
vMaxDate - vMinDate + 1;

I tried in the above way it is executing properly..i think you are getting the error may be you didnot declare the variables vMinDate and vMax Date.

check it once..

Regards,

Ajay

Not applicable
Author

Temp:
load
num(min(Date)) as MinDate,
num(max(Date)) as MaxDate
Resident

Data;

LET vMinDate = peek('MinDate',0,'Temp');
LET vMaxDate = peek('MaxDate',0,'Temp');

Drop table Temp;

DateIsland:
Load
date($(vMinDate) + rowno() -1) as D,
year($(vMinDate)) + rowno() -1) as Y,
month($(vMinDate)) + rowno() -1) as M,
date(monthstart($(vMinDate)) + rowno() -1),'MMM-YYYY') as MY
AUTOGENERATE (vMaxDate - vMindate + 1);

This is my code ...

can u pls check whats wrong in bove script

gandalfgray
Specialist II
Specialist II

in the LET statement you use uppercase D vMinDate

in the autogenerate you refer to vMindate (lowercase d)

Not applicable
Author

thanks buddy