Hi PI Square,
I wrote a small utility that I use to backfill/recalculate analyses. Here's a description:
Programmatically backfill and recalculate AF Analyses for the OSIsoft PI System. Supported only for PI AF 2.8.5+, PI Analysis Service 2.8.5+, and PI Data Archive 3.4.405+
This utility allows the user to backfill/recalculate analyses from the command line. It allows the user to specify the element, a filter for the analysis name, the time range, and the mode. This utility supports two modes: backfill and recalc. Backfill will fill in data gaps only. Recalc will delete all values in the time range and then calculate results.
AnalysisBackfill.exe \\AF1\TestDB\Plant1\Pump1 FlowRate_*Avg '*-10d' '*' recalc
AnalysisBackfill.exe \\AF1\TestDB\Plant1 *Rollup '*-10d' '*' backfill
I've found the utility to be useful for doing scheduled recalculations of my data, or for prepping an environment for a demo or class. I imagine that others would find a use for it as well.
I've put the code on my GitHub account. Please feel free to use under the GNU General Public License. And feel free to contribute and make any suggestions/changes.