Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, this is a snippet of my script load editor:
I have the error "unexpected token" at line 68, the [Data Documento] on the right is the problem. Compiler expects an operator, a ':' or a ','. I really don't understand why it's wrong, since syntax seems correct from what i saw online.
Here the error log:
Your age-variable assignment is wrong and results in NULL which removed the variable. Reason is your attempt to access maxdata. In general no values could be accessed on the outside of load-statements unless using functions like peek() or fieldvalue() and so your variable-creation may look like:
let var = fieldvalue('fieldname', 1);
Hi , you can't define [Data Documento] twice.
[Data Documento], $(AgeofMostRecentDate) AS [Data Documento2] should work
Your age-variable assignment is wrong and results in NULL which removed the variable. Reason is your attempt to access maxdata. In general no values could be accessed on the outside of load-statements unless using functions like peek() or fieldvalue() and so your variable-creation may look like:
let var = fieldvalue('fieldname', 1);
hello. Thanks for your reply. Unfortuntely, I already tried some different names on the right of the AS, such as [Nuova Data Documento] (which means new document date), but I got the same problem.
Hello, thanks for your reply. From what I can see from documentation, it appears that fieldvalue with 1 accesses the first element in the loading order of that field. I don't understand how can this solve a problem. Does it fetch the biggest (most recent) date in that field even from outside the load statement?
The field-value access per peek() and fieldvalue() is only on a defined index - but the table-records and/or field-values could be loaded in a certain order which makes a sensible access possible - especially if the first and/or last values are the wanted ones.
In regard to your case I referred to maxdata which you creates the step before and this table has just a single record and therefore the access per:
let var = fieldvalue('fieldname', 1);
or alternatively
let var = peek('fieldname', 0, 'tablename');
will work.
Thanks for your reply. Unfortunately, the error persists the same even after i changed the variable declaration as you said. ("unexpected token: [Nuova Data Documento]")
My examples were with var/fieldname/tablename just generic - you need to apply the existing ones.
sorry I'm stupid as hell. Will try now.
unfortunately, the exactly same error persists even after your suggestions. I really don't know what could be the problem at this point
thank you anyway