AnsweredAssumed Answered

Data validation in PI UFL interface

Question asked by Nandhini8588 on Sep 5, 2019
Latest reply on Oct 7, 2019 by pwedziuk

Hello All,

I am trying to set up a PI UFL interface for backfilling of data from another historian. I would like to do some validation on the data from the input csv files. Do we have any direct function that can be used in the IF statement in UFL interface to determine if the data is a number or string?


I have tried going through the post Re: PI UFL - Migrating Historical Digital Values from Another Historian, and tried storing the data in PI based on the quality. However in my case, even though the status is bad, the value is numeric. We have many rows for which the status is bad. So I do not want to write 'Bad data' in PI for each record that has a bad status. Instead I would want to write 'Bad data' in PI only if the value is not a number or its null.


Please see the sample values from the input csv file.


TagName, Timestamp, Value, Status
Test_1,01-JUL-19 23:45:00.2,    2.3,Good
Test_1,01-JUL-19 23:44:40.2,   -1.7,Bad
Test_1,01-JUL-19 23:44:20.2,   -0.4,Bad
Test_1,01-JUL-19 23:44:00.1,   -0.4,Good
Test_1,01-JUL-19 23:43:40.1,    0.8,Good
Test_1,01-JUL-19 23:43:20.1,   -0.2,Good
Test_1,01-JUL-19 23:43:00.1,   -0.4,Good
Test_1,01-JUL-19 23:42:40.1,    0.6,Bad
Test_1,01-JUL-19 23:42:20.0,    0.6,Good
Test_1,01-JUL-19 23:41:40.0,   -0.6,Good
Test_1,01-JUL-19 23:41:20.0,    0.8,Good
Test_1,01-JUL-19 23:40:39.9,   -0.6,Good
Test_1,01-JUL-19 23:40:19.9,    0.8,Good
Test_1,01-JUL-19 23:39:39.9,   -0.7,Good
Test_1,01-JUL-19 23:39:19.8,    0.7,Good
Test_1,01-JUL-19 23:38:59.8,   ---,Bad


As indicated above, all the ones in green should be stored in PI as such, although the status is bad. However for the one indicated in red, we should see 'Bad' or 'Bad data' in PI, as the value is not numeric.


Appreciate any suggestions or help on this.