Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
I have a user that is assigned to a single thing via the OU structure. I use a calculation service to use the value of the thing as a source in the mashup to do a basic calculation. This is all working as it should.Where I am struggling is with assigning multiple things to a single user in order to add up the thing value using the source in the mashup.To put this into context:We have a building where each individual apartment has a cold water meter and a hot water meter. Our app allows the user to monitor the TOTAL water consumption per hour. So effectively we need to add the 2-meter values together and display it on a Bar chart in the mashup.Please advise, as we have been through all of the snippets etc and cannot figure out a way to do this. |
---|
Hi @Darryl to better understand the situation could you please clarify if these values which you want to Total up for each user are being stored in separate Things? Or are these values being entered manually at mashup's runtime?
Generically speaking this could be done via an InfoTable / DataTable that could pre-calculate and store Total values which you can pull via a service to display this Total value on the Bar chart.
Assuming that a user has proper visibility and property read permissions.
1. retrieve the Things and their property values (something like GetImplementingThingsWithData for example)
2. use DeriveFields to create the aggregated column (Here is an example that pulls in additional properties, but you can do mathematical logic as well https://community.ptc.com/t5/IoT-AR-Tech-Tips/Powerful-Things-you-can-do-with-DeriveFields/m-p/535264#M326%3F&art_lang=en&posno=1&q=derivefields&source=search)