10 Replies Latest reply on Nov 3, 2009 2:56 PM by spilon

    Using alias in the PI Calculation expression

    formerpigeek

      Hi,

       

      I've set up some aliases in the module database and I'm using them in the ProcessBook as values.

       

      One value needs to be calculated and now it has to be as an dataset in the ProcessBook to work. For example: ('tagname' / 400) * 100.

       

      In that expression I wish to change the tagname to alias but I can't use aliases there. Also it's not possible to use expressions when creating aliases...

       

      Does anyone have ideas how to work around this? I don't want to use any datasets / "hardcoded" tag names in the ProcessBook display.

       

      Thanks

        • Re: Using alias in the PI Calculation expression
          cescamilla

          Well, if you don't want to use datasets and no coding it would be impossible unless you use AF.

           

          What is it that you are trying to do exactly?

           

          something like ('alias' /400) * 100 and be able to use that into a Data Set... ?

           

          Because you know that a PI Calculation creates a Data Set, I think you mean using alias names inside a Data Set, in which case you could create a custom data set add-in or use AF... could you shed some light on the topic?

          • Re: Using alias in the PI Calculation expression
            Kenneth.Rice

            Hi,

             

            I just wanted to let OSI know that I have internal end users that would like the same function, only slightly different in the sense they would like to have the "variable" be feed from an object off of the PB itself i.e. a textbox.

             

            We plan to use AF to accomplish some of these things, but I read a comment on VCampus that implied even using AF and other tools, it would still be benefical for the clients (Datalink also) to have this flexibility so the End User does not have to wait on the PI Group.

             

             

             

            Thanks

              • Re: Using alias in the PI Calculation expression

                Interesting suggestion - passing this over to the ProcessBook team

                • Re: Using alias in the PI Calculation expression

                  Kenneth.Rice

                  it would still be benefical for the clients (Datalink also) to have this flexibility

                   

                  I forgot to mention you can already do that in PI DataLink, by simply refering to cells rather than hardcoding tag names in your PI DataLink formulas. In case you need to build a calculation expression that's dynamic (i.e. based on the value of a given cell), then you can use a combination of standard Excel features such as =CONCATENATE (or simply use the & operator to merge string and cell values).

                   

                  For more information on the usage expression calculation in PI DataLink (as opposed to Office/DataLink programming), I invite you to look at the ProcessBook, PI DataLink and RtWebParts online course and contact Tech Support if you need further assistance.

                    • Re: Using alias in the PI Calculation expression
                      Kenneth.Rice

                      Steve Pilon

                      Kenneth.Rice

                      it would still be benefical for the clients (Datalink also) to have this flexibility
                      I forgot to mention you can already do that in PI DataLink, ....

                       

                      Steve,

                       

                      Your absolutely right, my bad, I completely forgot, I think we have even had internal success with attempts at doing that...

                       

                      my apologizes, thanks for passing the ProcessBook suggestion to the Developers.

                        • Re: Using alias in the PI Calculation expression

                          No need to apologize - that's what we're here for

                           

                          As for the ProcessBook data sets dealing with objects from the display, it's a bit more complicated... Essentially, when you create a PI Calculation Dataset in PI ProcessBook, you are using PI Performance Equations (PE) syntax to do that. PI ProcessBook does not parse the expression you enter (it rather sends it to the PI SDK exactly as it is entered by the user), so there is no way to put in a placeholder.

                           

                          There are existing open requests to have PI ProcessBook PI Calculation Datasets support some kind of variable input. Since it would require that PI ProcessBook handle all the parsing for PE syntax, it isn't likely to happen. However, there may be a better answer forthcoming from AF.

                           

                          One relatively easy way to achieve this now, would be to change the dataset expression yourself in code. You would simply make use of the Dataset.Expression property, a read/write string property that returns/sets the expression for the Dataset.

                           

                          Hope this helps!