
Re: Question about how to set analytics for realtime.
Rick Davin Aug 18, 2017 2:13 PM (in response to AMarques)1 of 1 people found this helpfulHello André,
I will leave it to your SPOC Facilitator to address your first question. As for your second question, allow me to explain the differences between a Formula DR and a Asset Analysis performing a Rollup.
About Formula DR:
 Calculates ondemand  for simple formulas with one or two inputs, this is a nice feature but for more complicated formulas with lots of inputs this can have negative performance
 Does not work with strings
 Works with only one event horizon, that is to say all input attributes only have a single AFValue associated with each. For instance, you cannot request a sum or average for a time range. You cannot fetch the previous value for any of the inputs
 Fairly simplistic and minimal editor
About Asset Analysis:
 Can calculate ondemand or persist calculations to the PI Data Archive. For more complicated analyses, there are many useful PE functions not available to Formula DR such as TagAvg, TagTot, PrevEvent, PrevValue, or TagVal just to name a few.
 Works well with strings
 Though its calculated for a given event, the analysis may use time range of data in calculations
 Nicer editor where expressions may span multiple lines and include comments (see this useful link) for better readability and easier debugging
If you search hard enough within PI Square or TechSupport, you may also find a Rollup DR. Note the Rollup DR was never an officially released product, and was intended more as a learning tool to show what CDR's could do. Though admittedly prior to the release of Asset Analytics I know some customers used the Rollup DR in their production databases. One serious shortcoming to the Rollup DR was that it did not persist the data back to the PI Data Archive, and sadly the very nature of a rollup is fairly intensive. Which is another way of saying it was sluggish as it was frequently going through intense calculations ondemand. Advantages of using an Rollup Analysis is (1) it's officially supported, (2) calculations were scheduled and performed once in the background, and (3) calculation results are saved back to the PI Data Archive, which gave a huge performance boost.

Re: Question about how to set analytics for realtime.
nifernando Aug 21, 2017 6:01 PM (in response to AMarques)1 of 1 people found this helpfulHello André,
Question 01:
I want to create a PI Coresight/Vision display where we can see value of MTD(month to day), last day, current day for uptime and production.
Note: For my plant our workday is 6:00 a.m to 6:00 am of next day.
Possible Solution:
I would do this task following way
 Last day uptime – Using an expression
 Current day uptime – using an expression
Can you please clarify how would you define your current day?If you consider your current day 6 AM (t+6h) to current time, then you can try this
 MTD
You can use BONM function – return a timestamp for midnight on the first data of a following month from a given time expression
Note: you can use the scheduling method according to your company requirements.
Question 02:
What's the difference of creating an attribute with a formula that do a sum or avg and performing an rollup analysis?
Possible Solution:
Rick has already explained this, please let me know if you have additional questions regarding on this.