2 Replies Latest reply on Jul 23, 2009 3:33 PM by kdoyle01

# PI Performance Equations: How to dynamically set NEXTVAL function TIME argument...

Context: Using PI Performance Equations NEXTVAL function as data source for Processbook display VALUE controls.

I need to set the TIME argument value dynamically, instead of using a static value.  That is, rather than using this format:

`NextVal('Sinusoid','T+23h+40m')`

I need to dynamically set the HOUR value, similar to:

`NextVal('Sinusoid','T' + '+' + Hour('*') + 'h+40m')`

However (if it's even possible), I can't figure out the correct syntax; keep getting PE Equation parsing errors.

I've tried using the CONCAT and TEXT functions, to construct the TIME value, to no avail.  (On a related note: why is a period (.) appended to the strings returned by those functions???)

Thanks,

Kevin Doyle

• ###### Re: PI Performance Equations: How to dynamically set NEXTVAL function TIME argument...

Hi Kevin,

while this probably fits more into techsupport than vCampus, some thoughts about timestamps. If you want to have the 'T+23h+40m' you might as well just use '23:40'.

I was playing arround in excel a bit and came to the following PE that should do the math for a dynamic hour:

`nextval('sinusoid',parsetime(concat(left(string(hour("*")),len(string(hour("*")))-1),":40")))`

Let me know how it works!

p.s. the '.' is caused by converting a number to a string. so we have to get rid of it with the left function.

• ###### Re: PI Performance Equations: How to dynamically set NEXTVAL function TIME argument...

Thanks Andreas!  PARSETIME was the trick.  ('Don't know how I missed that one!)

-Kevin