Skip to main content
Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for 
Search instead for 
Did you mean: 
sstephans
Contributor
Contributor

Unexpected token: '=', expected one of: '(', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', '

I'm trying to load entries from a previously loaded table where they are only from the last 3 calendar years. I have created a variable in the wizard with the definition

=FirstSortedValue(Year, -Date) - 2

and the code in the load script is:

LastThreeYears:
LOAD OrderID,
Year 
RESIDENT Orders
WHERE Year >= $(vStartYear);

 and it gives me this error. Can someone help please?

Syntax error

Unexpected token: '=', expected one of: '(', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', 'bitnot', 'LITERAL_NUMBER', ...

LastThreeYears:
LOAD OrderID,
	 Year 
	RESIDENT Orders
	WHERE Year >= >>>>>>=<<<<<<FirstSortedValue(Year, -Date) - 2

 

2 Replies
Sergey_Shuklin
Specialist
Specialist

Hello!

 

As I can see your result Where-condition is:

Where Year >== FirstSortedValue(Year, - Date) - 2

Try to remove equal sign from your vStartYear variable definition.

Brett_Bleess
Former Employee
Former Employee

If Sergey's post did the trick, could you please return to the thread and close things out by using the Accept as Solution button on his post for us?  This gives him credit for the help and it lets other Members know it worked.  If you did something different, consider posting that and then mark it after you post using the button.  

Ah, I think I may have found the other issue, I think you may have done a SET instead of  LET when you created the variable, which is I am going to post the Help links on those rather than try to explain things, but I think that could be the issue if Sergey's post did not work.

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

It is appreciated if you can be sure to close out your posts.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.