# PIAF analyses - Compute average of moving range

Question asked by simon76 on Apr 4, 2018
Latest reply on Apr 9, 2018 by simon76

Hi everyone,

I started to work on PIAF 2-3 weeks ago and I would like some help for an issue that I have. My objective is to construct an individual measurements control chart with PIAF analyses (expression).

The measures are vibrations and come from PI system. Below, a sample of my values:

 Date Value (mm/s) MR 21-juil-17 00:00:00 2,202375345 21-juil-17 04:00:00 2,110626916 0.09174 21-juil-17 08:00:00 2,228930486 0.11830 21-juil-17 12:00:00 1,935820779 0.29310 21-juil-17 16:00:00 2,202027916 0.26620 21-juil-17 20:00:00 2,309684407 0.10765 22-juil-17 00:00:00 2,436398957 0.12671

So, I need to compute UCL (UCL = /x + 3 * /MR/1.128 ; LCL = UCL = /x - 3 * /MR/1.128).

/x is average of column value. (computed with TagAvg() like the screenshot below).

/MR is the average of the column MR. MR = |value i – value i-1|

My problem is to compute /MR with PIAF. I don't know how could I do this because when we use an expression we can't have the same attribute in input and in output.

Maybe you have an idea to do that (I hope).