Looking for tool exclude tagged data from an average function

I am pulling an average for a certain value using a gauge query and then am identifying outlying data using a tolerance value. Anything that falls outside the tolerance is id’d as an outlier. What I want to do is tag the outlying data in the device state in order to not include that in future average queries. Unless I missed something, I didn’t see how my gauge query would work for taking the “outlier” tag into consideration in the average query so I wanted to throw the question out there as to whether there might be some functionality that could accomplish that.

Thanks!

You have two options here …

  1. This is the one I would recommend, as it keeps the outlier data but allows you to query for only the normalized value …

    • Add a new attribute to your device. Its name and data type will depend on the attribute you have now that is occasionally reporting outlier data. But as an example, if the attribute were called “current” and it was a number type, the new attribute would be a number also, called “currentNormalized”.
    • Build a cloud workflow that uses a Device State Trigger to fire every time your device reports.
    • Add in the necessary nodes to determine whether the data is in fact outlier data.
    • If it is NOT outlier data, use a Device State Node to report the data on your normalized attribute for the device.
    • Make sure to use a Conditional Node to check if the normalized data attribute is on the payload at the start of the workflow, or else you could create an infinite loop error.
    • The benefit of doing this is that you still keep the outlier data in the system in case you need it in the future (e.g. want to know how many times the outlier data is occurring and potentially adjusting your application).
  2. If the device in question is an edge compute device and you’re reading data off the device’s inputs (i.e. through Modbus), you can deploy an edge workflow to it that does not report outlier data up to the cloud. The advantage here is you are generating fewer payloads, saving on bandwidth and monthly payload limits.

Thanks Dylan!

I think the first option will work but will the gauge queries pull in the null value for the gauge query average and treat it as a 0 or will that ignore the nulls?

Sorry, I should have clarified that - instead of making your gauge queries against the original attribute, you would instead query against the normalized attribute, which should be all of your data minus the outlier points.

Roger that. Perfect. Thank you!