Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
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
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;
it works this way,
I commented out the initial script and created the Dates file.
However, what happens with the script from training?