I am looking for help with a script to display only todays data unless todays data has not been displayed yet. If that is the case display yesterday data.
I am thinking it would be if today > 0 display today data if not display today-1
I got it to work once. When I test I get the results I want but the script picker now gives me this error
// Filter records with empty values (future dates)
var filt = Filter(fs, "REEDER_Percent_FULL IS NOT NULL REEDER_Percent_FULL <> ''")
// Sort filtered records for most recent first
var sorted = OrderBy(fs, "Date_ DESC")
// Return top record
return First(sorted)
This is what I have so far.
I am getting this error:
Execution Error:Expected "*", "+", "-", "/", "AND", "OR", [ \t\n\r], or end of input but "R" found.
You need an "AND" before the second statement in your SQL.
"...IS NOT NULL AND REEDER_Percent_FULL..."
EDIT: Change that to AND.
I am now getting data to display but it is still showing the Null data. How does the var filt apply to the sorted layer?
I edited my reply below, but I think we want an "AND" in the SQL statement, not "OR". Something that has a value of '', that is, an empty string, will still satisfy the "IS NOT NULL" condition, allowing it through. My mistake!
Thank you for your continued help on this.
I am not sure the "AND" is the issue. I added the change and this is what I get. I think the problem is that the "filt" var is defined but then not put into the result. I would think that the "sorted" var would need to reference the "filt" var at some point.