6 Replies Latest reply on Jun 17, 2016 5:49 PM by fbatista

    Formula Data Reference or Analysis Service?

    MPetro

      Hi, I would really appreciate some feedback on doing calculations in AF, specifically comparing DR formula vs Analysis.

       

      I have used mostly data reference formula for several reasons.

      (1) It is easier to configure simple expression (eg. mass = volume *density). The formula is built in the attribute. It is also easy to understand the calculation.

      (2) I copied and pasted similar attributes structure to different templates. So once I started with some calculations templates in formula, I basically relied on similar structure.

      (3) As an DR attribute, I have on demand calculation. No need of PI TAG. When performance is not an issue, it was ok.

       

      Then came Analysis. It offers some advantages, but copy and paste is not straight forward like in formula. The advantages I see are:

      (a) it can save the result in PI TAG.

      (b) Performance equation is available.

       

      Question 1) With the new features in analysis (I am currently using 2015 R2), what are the best practice to do calculations in AF?

      I already have some complex templates with DR formula. I would like to know if it is worth to convert them to analysis. The main advantage of formula was the on demand calculation (reason 3). Since analysis can now act like on demand calculation (save no history option), I wonder if analysis offers better performance over the formula (eg. faster on demand calculation).

       

      Question 2) Can I mix formula and analysis?

      I am having stability issue when I mix formula with analysis. Eg. An formula attribute is an input to an analysis. I couldn't find any recommendation on that. So I wonder if have to use analysis only.

       

      Thanks, Danke, Merci, Gracias in advance

        • Re: Formula Data Reference or Analysis Service?
          Marcos Vainer Loeff

          Hi Mauricio,

           

          Before we start, if you want to move your formulas to PI Analysis Service, make sure that all output attributes are using PI Points data reference. We have seen some issues when analysis are saved in attributes using different data references.

          Having this advice in mind, for sure you will have better performance if you use PI Analysis Service since the calculated data will be already saved (there is no need to make calculations on demand). Nevertheless, you probably don’t want to use a PI Point for simple calculations or you don’t have to migrate what you already have.

           

          Another thing to consider is that if this attribute is going to be used as input for other formulas or analysis. If this is true, PI Analysis Service is also more appropriate due to performance.

           

          If you have a more specific question please don’t hesitate to ask!

           

          I am sure others can contribute as well with more suggestions.

           

          Hope it helps!

            • Re: Formula Data Reference or Analysis Service?
              MPetro

              Hi Marcos,

               

               

              thank you for your feedback! I understand your recommendation. We learned that the hard way... (crashes)!

               

               

              We didn't want to use so many PI Points. So we chose to use DR formula instead of analysis.

               

               

              If I got it right, since 2015 R2 there is this new DR 'Analysis' that can receive the output of an analysis. No need of PI Point. Calculation is done on demand. In theory I could convert all the formulas to analysis without any extra PI point. I don't know if it is worth the effort though.

                • Re: Formula Data Reference or Analysis Service?
                  skwan

                  Hi Mauricio:

                  You are correct that if you configure your analyses not to save history, then your output attribute would be configured with the Analysis Data Reference which is on demand and would not require a PI Point.  In terms of performance, if you compare the same calculation in Formula DR and Analysis DR, they would be fairly similar.  This is because Formula DR are relatively simple.  However, Analysis DR supports many more functions and has a more flexible way of composing the calculations, which can provide benefits to you.  You would have to make the determination as to whether you can simplify or enhance your Formula DR by converting it to Analysis DR.

                  For me, the Analysis DR gives me more flexibility with more available functions and also allows me to name my variables which makes the calculations much easier to read and debug so I lean towards using Analyses.

                  We have had some bugs when using Formula DR attributes as inputs to Analyses.  I suggest you look at the AF 2016 and PI Analysis Service release docs to see if any of the bug fixes applies to you.  Lastly if you're still having trouble, please contact tech support so we can identify the issue and fix it.

                   

                  Hope this helps.

                  --

                  Steve Kwan

                  6 of 6 people found this helpful
                    • Re: Formula Data Reference or Analysis Service?
                      fbatista

                      Hi Steve,

                      Are there plans to make Analysis DR usable in rollups? I know that "on the fly" rollups could impact performance if retrieved for a time range, but sometimes we just need the last value. I have recently to configure thousands of rollups with PI Points, but in fact the PI Points were not necessary, since I was interested in the last values only. I could have used the custom rollup data reference as well, but am trying to focus on standard features as much as possible. Using <None> as a DR also could affect performance, since the values would be stored in the AF database.

                       

                      Another thing that would make Analysis DR even more interesting is to allow creating a new Analysis DR attribute as a child of an existing attribute, directly from the analysis configuration plugin. Right now, as a workaround, I have to create it in the element level, then I copy/paste it as child of another attribute, and fix the mapping in the analysis after.

                       

                      Thanks,

                      Fabiano

                        • Re: Formula Data Reference or Analysis Service?
                          skwan

                          Hi Fabiano:

                          We current have no plans to support Analysis DR with Rollup.  We know, from history, that this would result in poor performance.

                          Can you further explain why you prefer the Analysis DR attribute as a child of an existing attribute?  During the design phase, we purposefully made sure the default output attributes are at the same level as the element so that from a debugging perspective, it's manageable.  Imagine you have tens of thousands of analyses with outputs scattering everything in the AF hierarchy.  It would be a management nightmare to try to figure out the relationship between the element, the input attributes, the analyses and the output attributes.

                          --

                          Steve Kwan

                          1 of 1 people found this helpful
                            • Re: Formula Data Reference or Analysis Service?
                              fbatista

                              Hi Steve,

                               

                              I would only configured it as a child in the cases that it would make sense, but for most of the cases I configure it at the element level. So, my suggestion is to add a feature, not to remove the existing one. Here is a simple use case:  suppose you have an attribute called "Power". We could have a child attribute to show "Alarm", which would be an analysis output based on the Hi and Lo limits values. In this example, having the "Alarm" attribute under it's related source (which is "Power'") would appear more organized than having it at the element level, and having to rename it as "Power Alarm" (in order to avoid conflict with other alarm calculations).

                               

                              Fabiano