AnsweredAssumed Answered

Table Lookup during Analysis

Question asked by adam.marshall on Jun 25, 2019
Latest reply on Jun 25, 2019 by sraposo

During my Analysis calculation I calculate a value which I would then like to look up on a table to see if a match exists, returning a boolean True. This lookup value does not come from a PI point attribute, it is a calculated date.

My analysis runs daily to parse PI data (a flow rate) and determine how to interpret it based on whether the previous day being a weekday or weekend, and needs to use this lookup to determine if a weekday is in fact a weekend day (holiday)


The detail:

I have a Library table 'Holidays' that contains a column 'Date'. The table data lists all the holidays applicable to the region. I want to lookup to see if the date being parsed (yesterday - 'y') exists in the table, returning TRUE if it is or FALSE if not.


My Issue:

I cannot see how to include this lookup based on data within the calculation (ie VLookup() in Excel) and pass it the data from the calculation. My research has shown how to do it based on input PI data references, but I can't see how to do this in the AF Analysis calculation.


As this will eventually be templated to operate across many elements in AF I need a way to dynamically look this data up from a common point.