So I am using a Data Expression for each of these elements within the dashboard.
The expression is:
var portal = Portal("");
var fs = FeatureSetByPortalItem(
portal,
"",
1,
[
"Date_",
"W_F_MGD",
"E_F_MGD",
"TOTAL_W_E_MGD",
"TID_FLOW_MGD",
"REEDER_Percent_FULL",
"TAP_FLOW_MGD",
"PLANT_PRODUCTION_MGD"
],
false
);
// Find the most recent date from the date field to filter the FeatureSet for the latest record
var maxDate = Text(Date(Max(fs,'Date_')),"YYYY-MM-DD");
return Filter(fs, "Date_ = @maxDate");
I do not know why the Gage has the latest information but the Indicators and pie chart are pulling from a few days ago.
Here is the result when I test the Expression:
Solved! Go to Solution.
Just to check, expand the date format to include the time. Since your timestamp is midnight, odds are it's adjusting the value for your time zone. If you were in UTC+6, then a midnight timestamp would show up as the previous date at 18:00.
You could use ToUTC to return the timestamp in the UTC value to avoid this.
Text(Date(ToUTC(Max(fs,'Date_'))),"YYYY-MM-DD")
Just to check, expand the date format to include the time. Since your timestamp is midnight, odds are it's adjusting the value for your time zone. If you were in UTC+6, then a midnight timestamp would show up as the previous date at 18:00.
You could use ToUTC to return the timestamp in the UTC value to avoid this.
Text(Date(ToUTC(Max(fs,'Date_'))),"YYYY-MM-DD")
Any idea how to use last edit date?
I was requested to add more dates past the current date.
[
"Date_",
"W_F_MGD",
"E_F_MGD",
"TOTAL_W_E_MGD",
"TID_FLOW_MGD",
"REEDER_Percent_FULL",
"TAP_FLOW_MGD",
"PLANT_PRODUCTION_MGD",
"last_edited_date"
],
false
);
// Find the most recent date from the date field to filter the FeatureSet for the latest record
var maxDate = Text(Date(ToUTC(Max(fs, 'last_edited_date'))),"YYYY-MM-DD-HH-mm");
return Filter(fs, "last_edited_date = @maxDate");
Here is the dashboard issue. I have our draw down past the current date but I cannot find a way to jump back and display the latest data that has been added. I thought last edit date would work but I keep getting no data.