I have an attribute template that uses a table lookup that works fine when not using the history option but fails when turned on eg:
- Table defined:ValidatedInputs with columns starttime (datetime), tagname (string), Value (Double);
- data is consistent and the records are distinct with respect to the tagname and time;
- Attribute Template: Service Hours: SELECT Value FROM ValidatedInputs WHERE Tagname = @[Process Node ID]+'_MAN.dvServiceHours';UOM=h;RWM=DBNull;TC=StartTime;
- I am using the attribute "Process Node ID" combined with the string '_MAN.dvServiceHours' to find the column;
- It works fine when using the rule: select first row matching criteria but fails when using "Table Provided time series data" ie an attribute with history;
- it also works using this syntax: SELECT Value FROM ValidatedInputs WHERE Tagname = 'GDP101_MAN.dvServiceHours';UOM=h;RWM=DBNull
- it works if the whole column reference is in a single attribute reference too: eg if i make an attribute: Service Hours Tag, with the value: GDP101_MAN.dvServiceHours and have an attribute config in "Service Hours" as: SELECT Value FROM ValidatedInputs WHERE Tagname = @[Service Hours Tag];UOM=h;TC=StartTime;RWM=DBNull;
The error is:
The data method 'InterpolatedValue' is not supported on attribute 'Attribute 'Process Node ID' in Element 'DP101' in Element 'Darling Downs' in Element 'Sites''
It looks like AF can't perform string concatenation in conjunction with the history mode turned on in the where clause .... weird ...