Average calculation on List Item column

  • 9 December 2015
  • 2 replies
  • 1 view

Badge +8

Hi All

 

I'm using the List Aggregator - List Average function to calculate average of a column in a list item view.

 

However some rows in the table dont contain values therefore they should not be part of the final total.


seems that the K2 control is working out the average even if cells contain no value

 

e..g my list has 10 rows of which 7 have values
calculation should be total of all rows  / 7

 

Am I missing something?


2 replies

Userlevel 3
Badge +8

dear , 

the first work arround that i would think of is the following ,

 

Create 2 text boxes , first with initial value = 0 , Second with an expression : first text box +1 

 

go to the place u want to action the list average  ,

first off use for all items in list view Rule 

 check (if Value is availabe then)

Transfer data from text box 2 , to text box 1 .

finally u will have the number of rows which has "Value" 

if 7 has value out of 10 , u will have number 7 in text box 1 .

 

Then use an expression using "List Sum" of the data field u want to sum , then use text box 1 to be the dividor .

u will have the sum of all fields values / textbox1 (which has the number of rows that has a value in it)

 

hope it helps ,

best regards.

Badge +7
Hey,

When you say some rows don't have values, do they are empty?

Reply