Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
After upgrading, one document (No changes) keeps failing while running
all the others are fine.
the massage:
Syntax error
Unexpected token: '0', expected one of: 'IDENTIFIER', 'LITERAL_STRING', 'LITERAL_FIELD', 'Each'
For >>>>>>0<<<<<<=0 TO 137
the log :
2018-03-12 21:27:37 0080 Let vStart = 0
2018-03-12 21:27:37 0081 Let vCount = 0
2018-03-12 21:27:37 0083 Let vDay=Ceil((Today()-'01/01/2007')/30)
2018-03-12 21:27:37 Error: Unexpected token: '0', expected one of: 'IDENTIFIER', 'LITERAL_STRING', 'LITERAL_FIELD', 'Each'
2018-03-12 21:27:59 Execution Failed
2018-03-12 21:27:59 Execution finished.
--------------------
the script:
Let vStart = 0;
Let vCount = 0;
Let vDay=Ceil((Today()-'01/01/2007')/30);
For $(vStart)=0 TO $(vDay)
MSLB_Table:
LOAD
$(vCount) AS Row,
Plant_Material_Key,
AddMonths(MakeDate(Left(YearMonth,4),Right(YearMonth,2),'01'),-$(vCount)) AS Date,
Batch,
Material,
Plant,
Storage_location,
//Inv_Year,
// Inv_Month,
QTY_Unrestricted,
QTY_QM,
QTY_Blocked,
QTY_Returns,
Vendor_Code
FROM D:\qlikview data\MM\Qvd_Inv\Inventory_MSLB.qvd (qvd)
Where Year(AddMonths(MakeDate(Left(YearMonth,4),Right(YearMonth,2),'01'),-$(vCount)))>='2007'
;
Let vCount = '$(vCount)'+1;
NEXT $(vStart)
...
-----------------------------
any advice ?
thanks in advance
guy
It looks like either vStart or vDay is not working as expected.
I would debug the code by adding exit scripts; before the for loop and verify if all variable statements work fine.
Good luck.
As said above, vDay is not being assigned. If you single step in debug mode you will be able to examine the value of the variables.
Try this code instead:
Let vDay=Ceil((Today() - MakeDate(2007)) / 30) |
Thanks for the comments Jonathan & Yuji
The variables are populated with values vStart = 0 and vDay = 137 as expected.
Before upgrading - the script has worked stable for more than two years..
Hi Guy,
The issue related to new BNF script reload mode after upgrade to QlikView November 2017,
see enclosed and add EnableBnfReload=0 under the [Settings 7]
Update the QV.exe Settings.ini file by adding the line EnableBnfReload=0 under the [Settings 7] tag for the default reload setting "EnableBnfReload".
By default, Settings.ini can be found in C:\%USER%\AppData\Roaming\QlikTech\QlikView
Update the QVB.exe Settings.ini by adding the line EnableBnfReload=0 under the [Settings 7] tag for the default reload setting "EnableBnfReload".
By default, the Settings.ini can be found in C:\Windows\System32\config\systemprofile\AppData\Roaming\QlikTech\QlikViewBatch.
It's will resolved the issue
BR
Eyal
got it
Local solution: For variables populated by the loop, it is necessary to change the syntax
vStart instead of $ (vStart) - in the populated variables
For vStart=0 TO $(vDay) like that..
for more suitable solution:
there is a new script reload mode called BNF - To support the existing script unchanged, add / change the BNF parameter to BNF = 0
Can be done in a script for one app by adding /// $ bnf off
Or change ini setting - add EnableBnfReload = 0 under [Settings 7] tag for qvb and qv
The Settings.ini solution works like a charm! Thank you!