Example on Rollup
Can someone please show me how to use Rollup function in Calc
3 replies
-
Hi adand ,
The Rollup function is specifically an asset-based calculation. If you have not created a virtual view with assets, then this function is of no use. Also, it can only run on a Periodic frequency, not on Value Change.
If you have a virtual view that has assets, you will want to pick that view using the Asset Path. Then you will want to select a parent asset type from the Asset Type drop-down. In my screenshot, the PumpingStation is a parent asset of a Pump asset.
The first parameter in the function is the source path which is the 'Asset Path + %Asset%'. We use %Asset% as a wildcard as each asset has a unique path. The second parameter is one of the Rollup operations. In my example, I am using Average. The third parameter is the child asset type. In this example, the Pump asset is a child asset of the PumpingStation. The fourth parameter is a tag of the child asset. In this case, each Pump has a Flow tag.
So every hour this calculation will average the Flow tag of each Pump and roll that value up to its parent PumpingStation.

The output must contain the wildcard, %Asset%, as is the case for all asset-based calculations.
Each PumpingStation will now have an hourly [PumpFlowAvg] tag.

-
Thanks for the help
-
Hi Steve,
We are using rollup calc pretty extensively. We are running into a data scenario in our view hierarchy. Where some instances of the tag does not exist or may have bad readings.
Just wondering how Canary handles that. Here is an example.
Asset Type: Field
The expression: Rollup('Well Aggregates.%Asset%', 'AVERAGE', 'Well', 'Casing Pressure')
Basic idea: We have about 50 fields, so we'd like to have an average casing pressure across each well for each field.
So the expectation is to get 50 tags named like "Field Average Casing Pressure" for each field.
However, due to whatever operational reason, not ALL wells have this " Casing Pressure" tag.
So for example: We have casing pressure tag for say 100/110 wells of a particular field.
We still find the the average valuable, even with the 10 wells of data missing.
Hopefully the question makes sense. Any ideas on how this gets handled?
Thanks,
Frank
