Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

average but not avg()

Hi


I know avg is not that function I need, but I am not sure what is...


I have put all the details in my example file.


Thanks

Oli

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

=sum([# Order line value]) / count( distinct [Inv Month])

View solution in original post

9 Replies
swuehl
MVP
MVP

Try

=sum([# Order line value]) / count( distinct [Inv Month])

kji
Employee
Employee

sum([# Order line value])/Count (DISTINCT [Inv Month])

Not applicable
Author

Hi

use this expression

sum([# Order line value])/Count(TOTAL DISTINCT [Inv Month])

find the attached Qvw

its worked fine.

adamwilson
Partner - Creator
Partner - Creator

this gives the desired result, although I would try to remodel the data to avoid using DISTINCT

sum([# Order line value]) / Count(DISTINCT [Inv Month])

Not applicable
Author

hi i don't understand what u want clearly,do u want something like this?please check attached file

Not applicable
Author

Like attached?

Or put this in your expression field:

=avg(aggr(sum([# Order line value]),[Inv Month]))

Not applicable
Author

I am attaching your application with two options, one based on counting the number of months and the other using Dimensionallity().

MayilVahanan

Hi

Try like this

=If(RowNo() = 0 or IsNull(RowNo()),  Sum([# Order line value]) / Count( DISTINCT

[Inv Month]),  Sum([# Order line value]) / Count( [Inv Month]))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Oli,

this expression should give you a cumulative sum of your [# Order Line Value] field. It should be simple to then calculate your average.

rangesum(above(total sum([# Order line value]), 0, only([Inv Month])))

Marcus

--edited as I missed out the rangesum!