Hello! I have some issues with historical tag readings.
We work with 3 shifts daily. From 06:00 to 14:00, from 14:00 to 22:00 and from 22:00 to 06:00; I have to make a perspective page to show the faults count and as a percentage of the overall cycles (B. in the picture below), for every 8 hour shift previous, limited to 20 shifts before.
For that I make a table with a history tag binding for all the fault counters (tags) and have the following for historic dates:
Start Date = dateArithmetic({view.custom.date},-(480*{../shifts_back.custom.value}),"minutes")
End Date = dateArithmetic({view.custom.date},-(480*{../shifts_back.custom.value}),"minutes")
In my view I have a custom property that will select the current shift start date:
if (getHour24(now())>= 6 && getHour24(now())< 14, dateFormat(now(),'yyyy-MM-dd 06:00:00'),
if(getHour24(now())>= 14 && getHour24(now())< 22, dateFormat(now(),'yyyy-MM-dd 14:00:00') ,
if(getHour24(now())>= 22 && getHour24(now())< 23, dateFormat(now(),'yyyy-MM-dd 22:00:00'),
dateArithmetic(midnight(now()),-2,'hours')
)))
The buttons are to move back and forth between previous shifts and change the number of the property for number of shift (0-20), so depending on the amount of shifts the user wants to go back, the:
dateArithmetic({view.custom.date},-(480*{../shifts_back.custom.value}),"minutes")
should return the desired date (I use it for both start date and end date).
It was working until the last 6 shifts, now I get a log warning that says PropertyReference failed to read value, for A. and B. (in the Picture above) and same for the table
Does anyone know what the problem might be? Should I come up with another way to set the start and end dates? I only want the last value before the end of the shift that is to be looked at