We perform inspections, where uncorrected and corrected gas meter readings are obtained.
To verify the readings are accurate, a formula is manually performed:
((a - b) x pfactor) + c
What’s the best way and location to perform this calculation automatically?
Thought about Survey123, but don’t have a way to bring in last month’s reading.
Thought about a Dashboard, but can’t do complex calculations like that in Enterprise Portal.
Thought about an arcade expression in a feature pop-up on a map, but would be very time consuming to click on each point inspected during the month to verify readings.
What are you using for an RDBMS? I am not a DBA but you can define triggers in your RDBMS to do calculations - https://docs.oracle.com/cd/B13789_01/appdev.101/b10795/adfns_tr.htm
It's a hosted feature layer within our Enterprise Portal consisting of point features & related tables. The inspections are being performed on the related tables.
Triggers in Portal are called webhooks but the documentation does not list a trigger for updating a value in the related table - https://enterprise.arcgis.com/en/portal/latest/administer/windows/create-and-manage-webhooks.htm
What version of Portal are you working with? With the recent addition of data expressions, this kind of thing would be absolutely doable in a dashboard.
10.8.1; so, no data expression capability.
Well, nuts. Next best thing is to create a new field to hold the calculation and have a small Python script to update the field on a regular basis. It's usually pretty simple, but referencing related tables could make things a bit more involved. Would something like that work for you?
Any chance there's a public view of the layer?
No public view of the data, but an example would be:
Last Month's Readings:
This Month's Readings:
Calculation to verify this month's Corrected Reading is accurate (or close to it):
((341,985 - 337,374) x 4.745) + 500,610 = 527,234 (which is close to this month's corrected reading of 527,239)
Was able to pull data from the related table into the feature's pop-up using the code in this blog.
In talking with the end user, they would be ok with having a calculation performed within this pop-up, enabling them to click on each site to see the calculation results.
I'm a novice when it comes to arcade expressions (I can usually figure them out once I have one, tweaking it to suite my data) - any assistance on what an arcade expression would be to perform my calculation within the feature's pop-up?