Like a spreadsheet formula, but better
In a spreadsheet, each cell contains either a value or a formula which is based on the value of other cells:
A |
B |
C |
D |
E |
|
1 |
Q1 |
Q2 |
Q3 |
Q4 |
TOTAL |
2 |
1000 |
2000 |
3000 |
4000 |
=SUM(A2:D2) |
Formulas are really useful for:
- Consistency: Whenever input data changes, everything dependent on that data updates automatically. The same happens if the formula was initially wrong and you correct it - all dependent data updates.
- Simplicity: Formulas turn the spreadsheet into a tool which can be used by people who don’t have to understand the details of how the calculations work - they can just put in new values and get the correct answer.
- Convenience: Formulas can be re-used, saving time and effort
DevicePilot’s recent release of Calculated Properties (CPs) delivers the power of formulas to the world of streaming data - with some special features which make them even more powerful. Of course, the difference between DevicePilot and a spreadsheet is that the data is constantly streaming in live and there might be millions of historical values per device.
Calculated Properties
To define a Calculated Property go to the top of the Settings/Properties page and hit "Create New" next to Calculated Properties.
You give a name and an expression in terms of other properties of the device and then the CP behaves just like a 'real' property of the device - you can use it everywhere you see or define a property in DevicePilot, adding analytical power at the beginning of the pipeline and improving the Consistency, Simplicity and Convenience of your solution.
Calculated Properties can be used to do unit conversion, merge and explode properties, extract and manipulate strings, all on-the-fly ... and perhaps their more powerful feature comes from the fact that they can see the previous state of each property too (and the current and previous timestamp). This allows them to do some very neat things such as integrating power into energy, and turning changes in lat/lon co-ordinates into distance moved over the surface of the Earth.
Explore the full power of DevicePilot Calculated Properties.