Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

LOAD TABLE/ AUTOGENERATE

Hello all,

I am new with the QV and working on the training.

I can't load the resident table I create, here is the script

 

Tempcalendar:

LOAD

$(VARMINDATE)+ROWNO()-1 AS DATENUMBER,

DATE ($(VARMINDATE)+ROWNO()-1) AS TEMPDATE,

AUTOGENERATE $(VARMAXDATE)-$(VARMINDATE)+1;

no error message pops up,

The debugger shows,

VARTODAY41301

VARMAXDATE<NULL>

VARMINDATE<NULL>

Is there something wrong with the autogenerate?

THANK YOU!  

4 Replies
Not applicable

Re: LOAD TABLE/ AUTOGENERATE

You have a syntax error due to the comma before AutoGenerate. But I think your problem should be in the variable assignments. If you try the following script, it will work:

SET VARMINDATE = MakeDate(2012, 1, 1);

SET VARMAXDATE = MakeDate(2012, 12, 31);

   

Tempcalendar:

LOAD

$(VARMINDATE)+ROWNO()-1 AS DATENUMBER,

DATE ($(VARMINDATE)+ROWNO()-1) AS TEMPDATE

AutoGenerate $(VARMAXDATE)-$(VARMINDATE)+1;

JG

Not applicable

Re: LOAD TABLE/ AUTOGENERATE

JG Thanks

but,

I've tried to remove the comma, but I get an "ERROR IN EXPRESSION" message in the debugger.

 

regarding the SET function, I cannot put specific dates I must use the min and the max dates of the ORDERDATE field of the ORDERS table.

again thanx

 

 

Not applicable

Re: LOAD TABLE/ AUTOGENERATE

OK, then take a look at this one:

Directory;

DatesTable:

LOAD A AS LoadedDates

FROM

Dates.xlsx

(ooxml, no labels, table is Dates);

MaxMinDates:

LOAD

          Max(LoadedDates) AS MaxDate,

          Min(LoadedDates) AS MinDate

Resident DatesTable;

VARMINDATE = Peek('MinDate');

VARMAXDATE = Peek('MaxDate');

 

Tempcalendar:

LOAD

$(VARMINDATE)+ROWNO()-1 AS DATENUMBER,

DATE ($(VARMINDATE)+ROWNO()-1) AS TEMPDATE

AutoGenerate $(VARMAXDATE)-$(VARMINDATE)+1;

Not applicable

Re: LOAD TABLE/ AUTOGENERATE

it works this way,

 

I commented out the initial script and created the Dates file.

 

However, what happens with the script from training?

 

 

Community Browser