Showing posts with label subtotal. Show all posts
Showing posts with label subtotal. Show all posts

Thursday, February 16, 2012

Average problem

Hi,
I've a subtotal row in a matrix. I do an average of a column but the avg
function return me the average of all results of each rows. In fact, I want
do the average of each colums except where the results is equal to 0.
How can I do that?Aggregate functions like Sum, Count, Avg, etc. only consider values which
are not null.
Try this:
=Avg(iif(Fields!X.Value = 0, Nothing, Fields!X.Value))
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Seb" <Seb@.discussions.microsoft.com> wrote in message
news:AA16A434-5BB4-4D03-B9E8-4C4D5224BB1D@.microsoft.com...
> Hi,
> I've a subtotal row in a matrix. I do an average of a column but the avg
> function return me the average of all results of each rows. In fact, I
want
> do the average of each colums except where the results is equal to 0.
> How can I do that?

Average Percentage in Matrix Subtotal

I have a matrix like the following:

Period 1 2 3 4 etc. Should be:
name1 3% 1% 2% 3% 2.25%
name2 4% 2% 1% 5% 3%
etc.
Should be: 3.5% 1.5% 1.5% 4%

I want to get the average percentage along the bottom row and the last column.
Using subtotals it just adds all the percentages. Is there any way to do
this? I've seen a lot about InScope but I'm not sure if it would help or how
to use it

These threads might help answer your questions:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=22493&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=648316&SiteID=1

Average Percentage in Matrix Subtotal

I have a matrix like the following:

Period 1 2 3 4 etc. Should be:
name1 3% 1% 2% 3% 2.25%
name2 4% 2% 1% 5% 3%
etc.
Should be: 3.5% 1.5% 1.5% 4%

I want to get the average percentage along the bottom row and the last column.
Using subtotals it just adds all the percentages. Is there any way to do
this? I've seen a lot about InScope but I'm not sure if it would help or how
to use it

These threads might help answer your questions:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=22493&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=648316&SiteID=1

Average in Matrix

Hi Everyone!
I have a question about a matrix in RS.
Its possible to add a Subtotal to a matrix bij right-clicking and Add
Subtotal:
PAUL | 1
MIKE | 4
JOSE | 8
TOTAL | 13
But how can i get the average in this matrix like:
PAUL | 1
MIKE | 4
JOSE | 10
AVERAGE | 5
Thanx,
Mike KlaarhamerHi,
I think (I'm not sure), you can add au subtotal in your matrix and If you
put on the row group principal your field with something like :
Your row | AVG(your field)
the subtotal return you the average of your fields column by column
"Mike Klaarhamer" wrote:
> Hi Everyone!
> I have a question about a matrix in RS.
> Its possible to add a Subtotal to a matrix bij right-clicking and Add
> Subtotal:
> PAUL | 1
> MIKE | 4
> JOSE | 8
> TOTAL | 13
> But how can i get the average in this matrix like:
> PAUL | 1
> MIKE | 4
> JOSE | 10
> AVERAGE | 5
> Thanx,
> Mike Klaarhamer|||Mike,
You can use the InScope-function (in combination with IIF) to determine
whether you are in a total-field during rendering.
You would become something like:
=iif(InScope("matrix1_YourGroup"),Fields!YourField.Value ),RunningValue(
Fields!YourField.Value ,Avg,"matrix1_YourGroup"))
Best regards,
Ive
"Mike Klaarhamer" <MikeKlaarhamer@.discussions.microsoft.com> wrote in
message news:A97160CC-A29C-4012-8D8E-8208FDFEADFD@.microsoft.com...
> Hi Everyone!
> I have a question about a matrix in RS.
> Its possible to add a Subtotal to a matrix bij right-clicking and Add
> Subtotal:
> PAUL | 1
> MIKE | 4
> JOSE | 8
> TOTAL | 13
> But how can i get the average in this matrix like:
> PAUL | 1
> MIKE | 4
> JOSE | 10
> AVERAGE | 5
> Thanx,
> Mike Klaarhamer|||Nope that does not work, post your rdl with a working example.
"Ive" wrote:
> Mike,
> You can use the InScope-function (in combination with IIF) to determine
> whether you are in a total-field during rendering.
> You would become something like:
> =iif(InScope("matrix1_YourGroup"),Fields!YourField.Value ),RunningValue(
> Fields!YourField.Value ,Avg,"matrix1_YourGroup"))
> Best regards,
> Ive
> "Mike Klaarhamer" <MikeKlaarhamer@.discussions.microsoft.com> wrote in
> message news:A97160CC-A29C-4012-8D8E-8208FDFEADFD@.microsoft.com...
> > Hi Everyone!
> >
> > I have a question about a matrix in RS.
> > Its possible to add a Subtotal to a matrix bij right-clicking and Add
> > Subtotal:
> >
> > PAUL | 1
> > MIKE | 4
> > JOSE | 8
> > TOTAL | 13
> >
> > But how can i get the average in this matrix like:
> >
> > PAUL | 1
> > MIKE | 4
> > JOSE | 10
> > AVERAGE | 5
> >
> > Thanx,
> >
> > Mike Klaarhamer
>
>