AnsweredAssumed Answered

AF Filtered Calculations

Question asked by fjmocke on Jun 9, 2017
Latest reply on Jun 21, 2017 by skwan

Hi everyone,

 

I need to calculate daily average truck speeds with certain filters in place.  Doing this in Excel using PI Datalink is easy, however doing the same in AF Analysis is a bit more tricky.  I've used this guide to setup my calculations:

Request Rejected

 

My problem is that I don't get the same answer using PI Datalink and using AF Analysis:

 

  • PI Datalink: 17.307
  • AF Analysis: 16.727

 

See below for how calculations was setup.  Any idea what I'm doing wrong?

 

DataLink Calculations

Data Item: Truck.Speed
Filter: ('Truck.Status'=228) AND ('Truck.Speed'>0) AND ('Truck.NetworkProblem'=0)

From: '*-1D'

To: '*'

Calculation Mode: average (time-weighted)

 

Answer: 17.307

 

AF Calculation

First I create a formula data reference attribute (Filtered Speed) with the following formula:

A=Speed;B=NetworkProblem;C=Status;[if A > 0 and B == 0 and C == 228 then A else 0]

 

 

Then I create an Analysis:

 

 

Answer: 16.727

Outcomes