Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

Performance equation to calculate the 4th thursday of November

$
0
0

Hi guys,

 

I'm trying to calculate a performance equation to identify the Thanksgiving day (the 4th thursday of November). I can't find a function like this:

  • WeekDayMonth(n, weekday, month, year)

For example: If we know the day of 4th (n=4) thursday (weekday=5) of current november (month=11, year=2014)

  • WeekDayMonth(4, 5, 11, 2014) = 27/11/2014

Is there any way to calculate this in a PE?

 

Is there any API for PEs to make this function and deploy it in a PI server?

 

The final PE could be:

 

if ParseTime("*")  = WeekDayMonth(4, 5, 11, Year("*")) then 1 else 0

 

Thank you in advance


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>