Data rollup option in Report(via Legacy UI)
-
Hi,
I am trying to create a report in the Legacy UI on points (kWh) that required 'Delta' rollup options.
I notice there is an option called 'Map Key'. Is this the option for rollup?
How else would I be able to generate such report?Thanks!
-
Hi cwangv,
The "Map Key" is simply the variable name to be used in the FTL under the "mapped" object. In the FTL it would look something like,
<#if mapped.mapKey??></#if>
which would check if a point with the map key "mapKey" was in the context. Otherwise as in thereportChartl.ftl
file one would have to loop over the points list, so it is not easy to get the point you want there.To get the delta you could do something like,
${ mapped.mapKey.stats.delta }
in the FTL. -
@phildunlap
Hi, Phil
Do you have more info on the syntax in the FTL that are available to use?Thanks.
-
FTL itself has a lot of quality reference material on its website: https://freemarker.apache.org/
If you mean what is included by Mango in the model passed to the template, the most authoritative place is the code: https://github.com/infiniteautomation/ma-modules-public/blob/main/Reports/src/com/serotonin/m2m2/reports/web/ReportChartCreator.java#L148
So we'd have to look somewhere else to see what's available in a context other than the reports, like here's the email handler building its model: https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/rt/event/handlers/EmailHandlerRT.java#L269