1 of 1 people found this helpful
First of all, timestamps and time spans are denoted by SINGLE quotes. You have double quotes, which is for literal strings. So the middle two parameters should be in single quotes. The 4th and final parameter should be in double quotes since you state the input tag comes from a string attribute.
Secondly, hard-coding an absolute timestamp into an Analysis is a horrible idea. No matter what end time you provide, the start time will always be Aug 1, 2018, even if you ran this for May 2019. Instead, you can use the relative PI Time of '1' to get midnight of the first day of the current month.
In addition to Rick's points, are you using any other data around these down times? I think capturing these downtime in event frames might be a possible alternative if you want some to consume some contextual data around these downtimes. You can use the new functionality in Analysis 2017 R2 to output to an AF Attribute the duration of the Event Frame and then do a roll up on this attribute if you want to know the cumulative downtime.
If you would like to know more about this approach, please let us know!