Weighted averages on categorized views

Hello,

It’s very simple to have simple averages, sums or percentages on a categorized view, but how to have weighted averages on a categorized view ?

For example:

A view with a single category and 3 documents:

  • Doc 1: value 1 = 100, weight = 5

  • Doc 2: value 2 = 200, weight = 2

  • Doc 3: value 3 = 600, weight = 3

The simple average is (100+200+600)/3 = 300

and the weighted average is:

( (1005) + (2002) + (600*3) ) / (5+2+3) = 270

Is there a mean to have this result automaticaly in a view with multiple categories (each category can have also itself multiple sub categories) ?

Thanks in advance.

Waldo

Subject: weighted averages on categorized views

can’t you just add the multiplication in the column value formula?

Subject: RE: weighted averages on categorized views

I don’t think that would work, because it’d give you ( (1005) + (2002) + (600*3) )

But the divisor would be 3 instead of 10, using the example

( (1005) + (2002) + (600*3) ) / (5+2+3) = 270

The problem is that when you click on the feature “Average” in the column properties, it isn’t referencing any field that might have these multiplier values. It just knows to divide by total/category number of entries.

Realistically, I think you need to have a button which does a quick ‘report’ for you in a document. I think that would be fairly straightforward, and only necessitated by the fact that the view doesn’t know how to do a weighted average based upon a field value.

regards,

raphael

Subject: RE: weighted averages on categorized views

That’s what I get for not looking at the right side of the /

Subject: RE: weighted averages on categorized views

Ok thanks !But how to build this “quick” report ?

I don’t think it’s easy …

As I wrote in the beginning: each category can have itself multiple sub categories.

Any other help ?

Waldo

Subject: RE: weighted averages on categorized views

On the other hand…

couldn’t you move the division into the column value and use totals instead of average?

It would require having prior knowledge of the weights being used…too bad you can’t do @db commands in columns…