2 Replies Latest reply on Jan 26, 2018 7:18 PM by kduffy

    dataset expressions and dashboard ?

      Is there any way to use an expression in a dataset or any other way such as   (((((   't' - 09-Jan-2018   ))))to subtract the current date from a preset date in the expression   to return a number of days count such as today being 1/25 -1/09=16 on the dashboard
        • Re: dataset expressions and dashboard ?

          Hi Justin,


          I'm assuming you are referring to a dataset in PI ProcessBook ? I believe you could do this with VB in ProcessBook.


          Doing this type of calculation in Asset Analytics is very simple:


          Day('t') - Day('09-jan-2018)


          You could write the result to a PI Point or an attribute with an Analysis Data Reference and refer to this attribute on your dashboard.


          Hope this helps,

          1 of 1 people found this helpful
            • Re: dataset expressions and dashboard ?

              This syntax is technically valid within ProcessBook, but I don't think it's going to give you exactly what you're looking for. If you do, for example, day('*') - day('28-Feb-2017') it should be something like 330, but it returns -2 since it's only looking at the day of the month.


              If you're within ProcessBook you could use VBA to take advantage of the UTCStartTime and UTCEndTime properties of a lot of symbols (this was introduced, I believe, in PB 3.3 or 3.4) as well as time difference calculation functions within Microsoft provided libraries that would accept string inputs. These properties are numberic types, so simply subtraction and truncation (if necessary) can yield the right number of days every time. The problem with VBA code is that, unlike datasets, they're not portable to Vision, and they also require code to be written.



              1 of 1 people found this helpful