Closed hol353 closed 4 years ago
Does the filter work if you use Report.Date
?
Nope. But
T.Date>'2017-11-20'
works. This is because T is used internally as an alias for the Report table. Not intuitive for the user though.
This one ought to be fixable if we rework the query into a proper table join. Will add it to the to-do list, unless you've already fixed it(?).
Nope I haven't touched it. I'll let you do it.
I have created a variable called Das from the report ([Sorghum].Phenology.DaysAfterSowing as Das), I am trying to plot the residuals (from the PreObsDatabase) vs Das and this is not working because Das is not a column in the PreObsTable. Is there a way to include this column from the Report to the PredictedObservedTable? I am not sure if the filter by date is working.
Yeah, that problem has been around a while and I'm not sure there's an easy fix on our end. To get this working on your end, I'd suggest copying the Das column from your report and pasting it into your observed file. If the column exists in both predicted and observed data, then it should be included in the PredictedObserved table, and the filter should work.
Thanks @hol430 It is quite difficult because my DailyReport is providing daily data, and therefore daily values of Das, and my Observed file has specific dates for the measurements. So I need to calculate Das for each value in the Observed file manually because each simulation has a different sowing date. Is there a way to select X values from a data source and Y values from a different data source in the current XY graphs?
Ah, yes that will be tricky. And no, it's not possible to get the X and Y values from different data sources. I guess a decent solution here might be for me to add a checkbox to the PredictedObserved UI which says something like "Include all columns in PredictedObserved table". When checked, all columns from both the observed and predicted data would be included in the merged table (normally, a column is only added to the merged table if it exists in both predicted and observed tables).
Only reason I haven't already added something like this is because it may slow down the PredictedObserved model if there are a lot of extra outputs in the report, but I guess if it's disabled by default then we could have the best of both worlds.
Ok, so please keep me in the loop if this will be implemented. It also provides the option to plot Pre-Obs data vs other variables would be in the Observed file, e.g. sowing date, irrigation applied, N applied, etc. Specifically, I am interested in plot Pre-Obs vs radn and RadInt which are in the DailyReport (not in the observed file). If you implement that checkbox, would include the final table both, data from observed and the DailyReport?
Yep - if DailyReport is your predicted table (ie the table you selected in the PredictedObserved UI) then yes, you will be able to plot anything in there against the data in the PredictedObserved table.
Thanks @hol430
If you're good with SQL script writing you could create a SQLite script (using a CLEM.CustomQuery) that will combine your two tables into a single VIEW in the database that you can plot or analyse the same as a table.
thanks @lie112 for the recommendation. I will have a look and try to advance with this.
There should be a new upgrade out which includes this fix, so if you upgrade to latest, the above filter ought to work, after you tick the extra box in the predictedobserved node and rerun it.
Thanks @hol430 already using it!
@hol353 why does the _Checkpoints table even have a Date column? As far as I can see this date column is never used. Seems like the simplest solution would be to get rid of it.
Yes the Date column in _Checkpoints can be removed.
If in report you output: [Clock].Today as Date
and then try and filter a graph series on this date: [Date]>'2017-11-20'
You get an error saying that Date is ambiguous. This is because the _Checkpoints table has a 'Date' field as well as 'Report'. The workaround is to call the report variable something else e.g. 'Date2'