Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have tried below srcipt running on my laptop for more then 10 times and it successful. but when i deploy this to qlikview server. it failed with error "Error: Unexpected token: ',', expected one of: 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', 'and', ..."
I dont know what else to be fixed. below is my script.
Month:
Load Distinct
num(Month(BIOMETRIC_DT), '00')as NumMonth
From
D:\QlikView\QVD\REPORT_HIST.qvd(qvd);
Let vCount = noofrows('Month');
For i=0 to $(vCount) -1
Let y = If($(x) = 0, 0, $(x) * -1);
Let vMonth = peek('NumMonth',$(i),'Month');
Let vYYYY = Year(MonthStart(AddMonths((Date(Today (), 'DD/MM/YYYY')), $(y))));
$(vMonth):
Load * from
D:\QlikView\QVD\REPORT_HIST.qvd(qvd)
where Month(BIOMETRIC_DT) = $(vMonth) AND year(BIOMETRIC_DT) = $(vYYYY);
Store $(vMonth) into D:\QlikView\QVD\DAILY_REPORT_$(vYYYY)$(vMonth).qvd(qvd);
Drop Table $(vMonth);
Next
And the error ended with:
2019-12-05 08:23:29 2469 Let vCount = noofrows('Month')
2019-12-05 08:23:29 2471 For i=0 to 4 -1
2019-12-05 08:23:29 Error: Unexpected token: ',', expected one of: 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', 'and', ...
2019-12-05 08:23:29 Execution Failed
2019-12-05 08:23:29 Execution finished.
How does the variable $(x) looks like?
Jim, did you get things figured out on your own, or are you still looking for help? Arthur posted a question for you, and that would seem to be the row causing the issue here, so if you were able to figure out what the problem was, please consider posting the solution yourself, and once posted, you can then use the Accept as Solution button on that post to mark it, that way others will know what the problem was too.
The only strange thing I see is in the row prior things are 0 to 4 -1 instead of 0 to 3, the -1 seems to not be taken into account, which may be same issue in the following line... Here is a Design Blog post that might be of some use:
https://community.qlik.com/t5/Qlik-Design-Blog/Loops-in-the-Script/ba-p/1473543
Regards,
Brett