Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I'm running some code in my report to generate a calendar, this code was given to me by a colleague and has been used in many reports prior to mine. There are no syntax errors but when i reload i get a script line error on the calendar. The portion of relevant code is below:
Range:
LOAD
min(WeekStart) as startdate,
max(WeekStart) as enddate
resident Tasks;
let vStart = peek('startdate',-1,'Range')-1;
Date:
Load
$(vStart)+recno() as Date
autogenerate $(vRange)
The error itself is:
Script line error:
Date:
Load
+recno() as Date
autogenerate
So i'm guessing that there is some problem with the variable and its value, but what i dont understand is why in the error is the variable missing. Does that mean its not getting any value out?
Any help will be appreciated.
Thanks
It looks like vStart is appearing null. I tried same code for vStart and it is providing me the correct result.Can you check your startdate has value or not and also try
vStart=Num(Peek(.....)) -1;
Hi,
You are using variable vRange to autogenerate, but there is no vRange assignment in your code, hence the error. Set (or LET) a correct value to that variable or change it by another numeric variable and the script will work.
Hope that helps.
Miguel
Ah yes, that is true. Thanks for pointing that out.
Putting that in helped but the overall problem was still there, but i found out that it was a simple problem of there being no data loaded in the primary table with my filters. It probably would be helpful if i knew the data i was working with in the future!
Thanks
It looks like vStart is appearing null. I tried same code for vStart and it is providing me the correct result.Can you check your startdate has value or not and also try
vStart=Num(Peek(.....)) -1;
Yeah that was the problem, i had filters on the table that fed data into vStart and i didnt realise that with those fitlers there wasnt any data so it was trying to use a null value. All sorted now
Thanks for everyones help