# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal will move to Qlik Community Oct 4. Temporary case outage Oct 3. READ DETAILS
cancel
Showing results for
Did you mean:
Creator

## Calculate Average in KPI from tables columns/current+previous rows

Hi, folks

I don't have idea how to put those value ion KPI using set analysis:

 N Previous  value Current Value Difference 1 32 32 0 2 32 32 0 3 32 32 0 4 33 32 1 5 33 33 0 6 33 33 0 7 33 33 0 8 33 33 0 9 39 33 6 10 39 39 0 11 38 39 -1 12 39 38 1 13 41 39 2 14 44 41 3 15 62 44 18 Average 2

1. First need to calculate difference between current and previous rows (if first row doesn't have previous use current)

2. Calculate the average based on difference

Please note that's all should be in KPI not in table

Thank you for you time and consideration

1 Solution

Accepted Solutions
MVP

Hi @Micki,  for this data:

``````Data:
N, Current Value
1, 32
2, 32
3, 32
4, 33
5, 33
6, 33
7, 33
8, 33
9, 39
10, 39
11, 38
12, 39
13, 41
14, 44
15, 62
];``````

You can use

``=Avg(Aggr(Rangesum([Current Value]-Above([Current Value])), N))``
MVP

Hi @Micki,  for this data:

``````Data:
N, Current Value
1, 32
2, 32
3, 32
4, 33
5, 33
6, 33
7, 33
8, 33
9, 39
10, 39
11, 38
12, 39
13, 41
14, 44
15, 62
];``````

You can use

``=Avg(Aggr(Rangesum([Current Value]-Above([Current Value])), N))``
Community Browser