What is the easiest way to show just the percent good data of a pi tag in PI DataLink? When I use the check box I get an array and can’t make changes to the array, like dragging the cell down to cover different days.

What is the easiest way to show just the percent good data of a pi tag in PI DataLink? When I use the check box I get an array and can’t make changes to the array, like dragging the cell down to cover different days.

- While this is somewhat laborious, it is possible to do that indirectly, by building the appropriate Performance Equation expression using an Excel formula, as in the attached sample spreadsheet.As you can see, I edit and view the formula in Portuguese in my computer, as my Excel is in Portuguese, but I believe you'll be able to view and edit the formula in English, if you download the spreadsheet and open it in your computer.Note also that the standard separator of Excel function parameters in Portuguese is a semicolon, while the standard separator in English is a comma.Anyway, there might be a simpler formula to obtain the same result, this is just a suggestion.Of course, a much simpler approach would be the following:
- use the DataLink Calculated Data function;
- choose a calculation mode related to the kind of pctgood you are interested in (time-weighted or event-weighted);
- show the pctgood; and
- hide the actual calculation column (i.e., minimum, maximum, average, total, etc., as you are not interested on it, in this case), using the Excel feature to hide columns.

I believe that DataLink does not offer the option to show only pctgood because the underlying PI-SDK method (Summaries2 method of the IPIData2 interface) or its PI AF SDK equivalent does not return the pctgood alone, but only associated with a calculation (minimum, maximum, average, total, etc). A slightly less complicated Excel formula to build the PE would be to use excel's text function to automatically format the time. This gets you the date in the proper format with only 1 command and eliminates the need to use the vlookup function and the table for the months. An example of what the formula would look like for the 1st row of Danial's example spreadsheet is below. This option also allows you to specify the start and end times down to the minute if needed.

=CONCATENATE("PctGood('sinusoid', '",TEXT(A2,"dd-mmm-yy hh:mm"),"' , '",TEXT(B2,"dd-mmm-yy hh:mm"),"')")

Peter's suggestion is a good one for people who keep Windows regional settings in English.

I wish either Excel's TEXT function allowed users to specify a locale different from Windows regional settings or the internal PI time format (used in Performance Equations) supported languages other than English... :)

An option is to use the Archive Value function with a Performance Equation expression that involves the PctGood function. For instance, if you want the percent good of tag sinusoid for yesterday, you can use the following parameters: