Showing posts with label matrix. Show all posts
Showing posts with label matrix. Show all posts

Sunday, March 25, 2012

Customised totals

Hi,

I am creating a report using matrix. The reporting services subtotal, sums up the data on all rows. The data in rows contains numeric & percentage values. I need the total for numeric value as sum and for percentage values as weighted average. Does anyone know how to do this or is this limitation of RS. Thanks.

You mean you want to have different calculation done in the subtotal as oppose to the one used in detail cells? If so, you can use the InScope function to do it. http://msdn2.microsoft.com/en-us/library/ms156490.aspxsql

Customer specific price matrix design (Long)

Hi All,
Not sure if this is the right group so feel free to point me in a better
direction.
Most of our customers have a personal price for every product but Im having
a nightmare trying to produce a price matrix on the fly. I currently have a
solution in MS Access 2K which uses a series of append and update queries to
create a temp table, this takes a little over 2 minutes to generate and is
becoming problematic. The idea is to have the sales office be able to give a
customer a price over the phone - a 2-3 minute wait isnt going to work.
I have 3 sources of prices
global : This contains a default price for every stock item it is the base
of all prices
price set(s): these contain a group of stock items from global at a
discounted price
personal product prices : A customer specific price for a specific stock
item
All prices can and do change and frequently and there are are also quantity
discount breaks for the same stock Item.
We carry approximately 3500 products and have about 4000 customers.
Im currently in the process or moving things from MS Access 2K over to MS
SQL Server 2K
I realise that its difficult to visualise without the database but if
someone could offer some pointers,
Im put off buliding 1 big flat table due to the size and the frequent
updates - am I right to avoid doing this?
Is it correct to construct the temp table and then running update/inserts -
Im having problems with the lack of a unique ID as Stock code is duplicated
for different quantity.
I can quickly generate a temp table containing all the information from each
source adding a field value for the process number (1,2,3 ) what Id like is
the record with the highest process number, but if I use a group by and max
as soon as I add price in the view I get all the records again.
I cant help but think I have something fundamentally wrong as its causing
such a problem. Can anyone point me at some info or share some insight.
TIA."Annon" <Ieatlotsofspam@.yum.yum> wrote in message
news:rNomf.5843$iz3.8@.text.news.blueyonder.co.uk...
> Hi All,
> Not sure if this is the right group so feel free to point me in a better
> direction.
> Most of our customers have a personal price for every product but Im
> having
> a nightmare trying to produce a price matrix on the fly. I currently have
> a
> solution in MS Access 2K which uses a series of append and update queries
> to
> create a temp table, this takes a little over 2 minutes to generate and is
> becoming problematic. The idea is to have the sales office be able to give
> a
> customer a price over the phone - a 2-3 minute wait isnt going to work.
> I have 3 sources of prices
> global : This contains a default price for every stock item it is the base
> of all prices
> price set(s): these contain a group of stock items from global at a
> discounted price
> personal product prices : A customer specific price for a specific stock
> item
> All prices can and do change and frequently and there are are also
> quantity
> discount breaks for the same stock Item.
> We carry approximately 3500 products and have about 4000 customers.
> Im currently in the process or moving things from MS Access 2K over to MS
> SQL Server 2K
> I realise that its difficult to visualise without the database but if
> someone could offer some pointers,
> Im put off buliding 1 big flat table due to the size and the frequent
> updates - am I right to avoid doing this?
> Is it correct to construct the temp table and then running
> update/inserts -
> Im having problems with the lack of a unique ID as Stock code is
> duplicated
> for different quantity.
> I can quickly generate a temp table containing all the information from
> each
> source adding a field value for the process number (1,2,3 ) what Id like
> is
> the record with the highest process number, but if I use a group by and
> max
> as soon as I add price in the view I get all the records again.
> I cant help but think I have something fundamentally wrong as its causing
> such a problem. Can anyone point me at some info or share some insight.
>
You'll need to post your table DDL, sample data and desired output for any
real information.
David|||which takes precedence? (i assume customer -> price set -> global)
how does a price set relate to the customer? (if it does)
if it doesn't, how do you know which to use? (assuming a stockno can be
in more than one price set)
what do you mean by a "process number"?
it would probably be best to avoid a big flat table in this case, but if
you make the source for this matrix a data warehouse, then that's
probably what you'll have.
DDL will certainly help get better answers...
Annon wrote:
> Hi All,
> Not sure if this is the right group so feel free to point me in a better
> direction.
> Most of our customers have a personal price for every product but Im havin
g
> a nightmare trying to produce a price matrix on the fly. I currently have
a
> solution in MS Access 2K which uses a series of append and update queries
to
> create a temp table, this takes a little over 2 minutes to generate and is
> becoming problematic. The idea is to have the sales office be able to give
a
> customer a price over the phone - a 2-3 minute wait isnt going to work.
> I have 3 sources of prices
> global : This contains a default price for every stock item it is the base
> of all prices
> price set(s): these contain a group of stock items from global at a
> discounted price
> personal product prices : A customer specific price for a specific stock
> item
> All prices can and do change and frequently and there are are also quantit
y
> discount breaks for the same stock Item.
> We carry approximately 3500 products and have about 4000 customers.
> Im currently in the process or moving things from MS Access 2K over to MS
> SQL Server 2K
> I realise that its difficult to visualise without the database but if
> someone could offer some pointers,
> Im put off buliding 1 big flat table due to the size and the frequent
> updates - am I right to avoid doing this?
> Is it correct to construct the temp table and then running update/inserts
-
> Im having problems with the lack of a unique ID as Stock code is duplicate
d
> for different quantity.
> I can quickly generate a temp table containing all the information from ea
ch
> source adding a field value for the process number (1,2,3 ) what Id like
is
> the record with the highest process number, but if I use a group by and ma
x
> as soon as I add price in the view I get all the records again.
> I cant help but think I have something fundamentally wrong as its causing
> such a problem. Can anyone point me at some info or share some insight.
> TIA.
>
>|||If you can't post the DDL, explain the rules.
ML
http://milambda.blogspot.com/|||"Trey Walpole" <treypole@.newsgroups.nospam> wrote in message
news:ODmZj5R$FHA.436@.TK2MSFTNGP10.phx.gbl...
> which takes precedence? (i assume customer -> price set -> global)
> how does a price set relate to the customer? (if it does)
> if it doesn't, how do you know which to use? (assuming a stockno can be in
> more than one price set)
> what do you mean by a "process number"?
> it would probably be best to avoid a big flat table in this case, but if
> you make the source for this matrix a data warehouse, then that's probably
> what you'll have.
> DDL will certainly help get better answers...
Hi Tery,
Your precedence is right, customer - price set then global, 1 to 3.
What im looking for,
Item Qty Price
Item1 1 2.25
Item1 10 1.5
Item2 10 1.9
Item3 100 4.99
Item4 1 2.2
The best I've come up with so far is to copy each stage (global, price set
then customers price) into a temp table with triggers to check if the
stock_Code and Qty match then update rather than append.
Any help suggestions welcome.
(SQL server is all really rather new to me still)
DDL hopefully below.
CREATE TABLE [dbo].[tbl_Customers] (
[ID] [numeric](18, 0) NOT NULL ,
[Company] [char] (10) NULL ,
[ID_Price_set_Global] [numeric](18, 0) NULL ,
[ID_Price_set_Main] [numeric](18, 0) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tbl_Matrix_Base] (
[ID] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,
[Price_Set_ID] [numeric](18, 0) NULL ,
[Company_ID] [numeric](18, 0) NULL ,
[Stock_Code] [varchar] (10) NOT NULL ,
[Quantity] [numeric](18, 0) NOT NULL ,
[Price] [float] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tbl_Price_Sets] (
[ID] [numeric](18, 0) NOT NULL ,
[Price_set_ID] [numeric](18, 0) NOT NULL ,
[Description] [varchar] (50) NULL
) ON [PRIMARY]
GO
insert into tbl_customers
([ID],Company,ID_price_set_global,ID_Pri
ce_set_main) values (1,'Test1',1,2)
Go
insert into tbl_price_sets ([ID],Price_set_ID,[Description]) values
(1,1,'Price set 1 Global')
insert into tbl_price_sets ([ID],Price_set_ID,[Description]) values
(2,2,'Price set 2 Band A')
Go
insert into tbl_Matrix_base
(Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
(1,null,'Item1',1,2.25)
insert into tbl_Matrix_base
(Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
(1,null,'Item1',10,2)
insert into tbl_Matrix_base
(Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
(1,null,'Item2',10,3)
insert into tbl_Matrix_base
(Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
(1,null,'Item3',100,4.99)
insert into tbl_Matrix_base
(Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
(1,null,'Item4',1,2.2)
insert into tbl_Matrix_base
(Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
(1,null,'Item2',10,1.9)
insert into tbl_Matrix_base
(Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
(null,1,'Item1',10,1.5)
Go|||Annon (Ieatlotsofspam@.yum.yum) writes:
> Your precedence is right, customer - price set then global, 1 to 3.
> What im looking for,
> Item Qty Price
> Item1 1 2.25
> Item1 10 1.5
> Item2 10 1.9
> Item3 100 4.99
> Item4 1 2.2
> The best I've come up with so far is to copy each stage (global, price set
> then customers price) into a temp table with triggers to check if the
> stock_Code and Qty match then update rather than append.
Is that table structure you posted carved in stone? Or can you change it?
I started to compose a query from your repro, but I found it darn
difficult as tbl_Matrix_base is so scattered. And there were also
some thing I did not understand. What does those two ID_price_set in
Customers mean? And your sample data had:

> (Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
> (1,null,'Item2',10,3)
> (Price_set_Id,Company_ID,Stock_code,Quan
tity,Price) values
> (1,null,'Item2',10,1.9)
How do I know which is which?
First of all, you need to keep track of which is which. To start with
you need a table to define sellable items:
CREATE TABLE sellable_items (stockcode varchar(10) NOT NULL,
qty smallint NOT NULL,
stdprice float NOT NULL,
CONSTRAINT pk_selleable_items PRIMARY KEY (stockcode, qty))
This table could just as well hold the standard price.
A price-set table would then look like this
CREATE TABLE priceset (pricesetid integer NOT NULL,
pricesetname varchar(30) NOT NULL,
CONSTRAINT pk_priceset PRIMARY KEY (pricesetid))
The actual prices in a price set would be in:
CREATE TABLE pricesetprices (pricesetid integer NOT NULL,
stockcode varchar(10) NOT NULL,
qty smallint NOT NULL,
price float NOT NULL,
CONSTRAINT pk_pricesetprices PRIMARY KEY
(pricesetid, stockcode, qty),
CONSTRAINT fk_prp_priceset FOREIGN KEY(pricesetid)
REFERENCES pricesets (pricesetid),
CONSTRAINT fk_prp_sellable FOREIGN KEY (stockcode, qty),
REFERENCES sellable_items (stockcode, qty)
)
Then then customer-specific prices:
CREATE TABLE customerprices (customerid integer NOT NULL,
stockcode varchar(10) NOT NULL,
qty smallint NOT NULL,
price float NOT NULL,
CONSTRAINT pk_customerprices PRIMARY KEY
(customerid, stockcode, qty),
CONSTRAINT fk_cup_customer FOREIGN KEY(customerid)
REFERENCES tbl_Customers (ID),
CONSTRAINT fk_cup_sellable FOREIGN KEY (stockcode, qty),
REFERENCES sellable_items (stockcode, qty)
)
Now to get all prices for a customer you can do:
SELECT s.stock_code, s.qty, price = coalesce(cup.price, prp.price,
s.price)
FROM sellable_items s
CROSS JOIN (SELECT * FROM tbl_Customers WHERE ID = @.custid) c
LEFT JOIN pricesetprices prp ON c.pricesetid = prp.pricesetid
AND s.stock_code = prp.stock_code
AND s.qty = prp.qty
LEFT JOIN customerprices cup ON c.customerid = cup.customerid
AND s.stock_code = cup.stock_code
AND s.qty = cup.qty
A very important thing to note here is the use of foreign keys, and
multi-column primary keys. A common mistake is to add an ID column to
each table and think you have a primary key. For basic concepts like
customers, this can be a good thing, but for composed entities like the
price plan is not.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns972985B77D074Yazorman@.127.0.0.1...
> Annon (Ieatlotsofspam@.yum.yum) writes:
<SNIP elegant solution>

> Now to get all prices for a customer you can do:
> SELECT s.stock_code, s.qty, price = coalesce(cup.price, prp.price,
> s.price)
> FROM sellable_items s
> CROSS JOIN (SELECT * FROM tbl_Customers WHERE ID = @.custid) c
> LEFT JOIN pricesetprices prp ON c.pricesetid = prp.pricesetid
> AND s.stock_code = prp.stock_code
> AND s.qty = prp.qty
> LEFT JOIN customerprices cup ON c.customerid = cup.customerid
> AND s.stock_code = cup.stock_code
> AND s.qty = cup.qty
> A very important thing to note here is the use of foreign keys, and
> multi-column primary keys. A common mistake is to add an ID column to
> each table and think you have a primary key. For basic concepts like
> customers, this can be a good thing, but for composed entities like the
> price plan is not.
>
Thanks for the solution Erland, unfortunatly as is always the way - Im stuck
with backward compatibility I cant rip out the tables and replace them with
the correct design. As you point out the problem is not know what is what
and from where it came. All the data is held in 1 table the tbl_Matrix_base,
customer, price set and global all lumped together. As time was pressing I
kept the temp table created a compound key field from Company & Stock_Code &
Qty , created a unqiue index on it but with ingnore_dup_key on. and ran the
3 insert queries. It adds new records but fails to add duplicates - as long
as I keep the insert order correct it gives me the results I need.
Its far from perfect - but its bought me more time, I'll take apart your
example and see if I can work it back into the live system.
Thanks again for the help.

Thursday, March 22, 2012

custom subtotals in a matrix

FY 2006 FY 2007 Total 1ST QTR 2ND QTR 3RD QTR 4TH QTR Total 1ST QTR Total Customer1 Count1 290 271 233 207 1001 200 200 1201 Count2 111 110 123 118 462 113 113 575 Customer2 Count1 12 12 12 Count2 9 9 9 Customer3 Count1 616 540 513 526 2195 531 531 2726 Count2 362 299 324 368 1353 347 347 1700 Customer4 Count1 7 12 15 22 56 26 26 82 Count2 3 1 7 9 20 9 9 29 Customer5 Count1 4 9 2 15 3 3 18 Count2 1 1 1 3 3 3 6 Customer6 Count1 1 0 1 1 Count2 0 0 0 0

I have the matrix above that displays the subtotals per customer(group_row), per quarter(group_column). I added a subtotal to the top group_column (year) so I can get grand total. I need to modify grand total formula to display variance instead.

I don't need to modify the subtotal formula per Customer/quarter , only per cutomer/Year. Is it possible?

You can use an IIf statement with an InScope check to determine which column or row you are in (i.e. are you inside the group still, or outside it) and have a different expression accordingly. Here is an example:

=IIf(

InScope("WeekCommencingGroup"),

DateDiff("d", CDate(Parameters!AsAtSnapshot.Label), CDate(Fields!Week_Commencing.Value)),

""

)

i use this to print a date difference in the regular rows, but not in the total row. You can use the same technique for your group, and can alter your expression in your Total column.

|||

Sluggy,

Thank you so much for your answer, but I'm not sure if you understand what I'm trying to do. The totals in my matrix are from the 'subtotal' function, not from a caculated column....

Perhaps I don't understand your answer...

|||

I have a similar situation I think my shed more light on the OP's Question.

If I have a database of fruit and stores, I can easily link the returns from a dataset into a matrix and get the number of each fruit at each store, and subtotals.

Apples

Oranges

Bananas

Total

Store 1

5

3

1

9

Store 2

5

2

1

8

Store 3

4

8

4

16

Store 4

8

1

2

11

Store 5

6

7

7

20

28

21

15

64

What I want however, is some way to find the percentage of each fruit at each store.

Apples

Oranges

Bananas

Total

Store 1

5

( 56% )

3

( 33% )

1

( 11% )

9

Store 2

5

( 63% )

2

( 25% )

1

( 13% )

8

Store 3

4

( 25% )

8

( 50% )

4

( 25% )

16

Store 4

8

( 73% )

1

( 9% )

2

( 18% )

11

Store 5

6

( 30% )

7

( 35% )

7

( 35% )

20

28

( 44% )

21

( 33% )

15

( 23% )

64

This would be easy if there was a way to call the Total cell at the end of each row, (# apples in the store / store total) but if that is possible I am at a loss to find it.

|||

For the fruit store example with percent of total, you just need to take the current value sum and divide by the row total. Do that with the sum function and scope.

The additional IIF statement ensures the report doesn't puke on a divide by 0.

=IIF(Sum(Fields!DATACOLUMN.Value,"matrix1_RowGroupName")=0,0,Sum(Fields!DATACOLUMN.Value)/IIF(Sum(Fields!DATACOLUMN.Value,"matrix1_RowGroupName")=0,1,Sum(Fields!DATACOLUMN.Value,"matrix1_RowGroupName")))

Replace DATACOLUMN with your sales field
Replace "matrix1_RowGroupName" with your matrix Row name


David Leibowitz
Business Intelligence Practice Manager
MaxQ Technologies
www.maxqtech.com

|||

I tried the following:

=iif(InScope("matrix1_AtYear") and InScope("matrix1_customer"),sum(fields!count1.value),var(fields!count1.value))

The Grand total will display the Variance, however it looks at the dataset to caculate this value. I'm doing all my grouping caIculation at the report level, not at the data set level. I want it to look at the total per quarter columns and use those number to come up with a variance. For instance the first row of the matrix I displayed above, I want to see (1001-200)/1001*100 = 80 .

|||

My Matrix name is Matrix1, my Row name is MatrixRow4 and the number value is "= Count(Fields!FruitDesc.Value)"

Code Snippet

=IIF(Sum(Count(Fields!FruitDesc.Value),"MatrixRow4")=0,0,Count(Fields!FruitDesc.Value)/IIF(Sum(Count(Fields!FruitDesc.Value),"MatrixRow4")=0,1,Sum(Count(Fields!FruitDesc.Value).Value,"MatrixRow4")))

On preview the report throws:

[rsAggregateofAggregate] The Value expression for the textbox 'textbox24' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions. [rsAggregateofAggregate] The Value expression for the textbox 'textbox24' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions. [rsAggregateofAggregate] The Value expression for the textbox 'textbox24' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions. [rsInvalidAggregateScope] The Value expression for the textbox ‘textbox24’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. [rsInvalidAggregateScope] The Value expression for the textbox ‘textbox24’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. [rsInvalidAggregateScope] The Value expression for the textbox ‘textbox24’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. Build complete -- 6 errors, 0 warnings|||

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

Possible helpful answer...

|||

Rageheart,

I hope this helps you or anyone else because I had the same problem.

Instead of "MartrixRow4" you need to right click on the detail and select 'Edit Group' from the dropdown menu. Use the name that is there, not the name of the row.

sql

custom subtotals in a matrix

FY 2006 FY 2007 Total 1ST QTR 2ND QTR 3RD QTR 4TH QTR Total 1ST QTR Total Customer1 Count1 290 271 233 207 1001 200 200 1201 Count2 111 110 123 118 462 113 113 575 Customer2 Count1 12 12 12 Count2 9 9 9 Customer3 Count1 616 540 513 526 2195 531 531 2726 Count2 362 299 324 368 1353 347 347 1700 Customer4 Count1 7 12 15 22 56 26 26 82 Count2 3 1 7 9 20 9 9 29 Customer5 Count1 4 9 2 15 3 3 18 Count2 1 1 1 3 3 3 6 Customer6 Count1 1 0 1 1 Count2 0 0 0 0

I have the matrix above that displays the subtotals per customer(group_row), per quarter(group_column). I added a subtotal to the top group_column (year) so I can get grand total. I need to modify grand total formula to display variance instead.

I don't need to modify the subtotal formula per Customer/quarter , only per cutomer/Year. Is it possible?

You can use an IIf statement with an InScope check to determine which column or row you are in (i.e. are you inside the group still, or outside it) and have a different expression accordingly. Here is an example:

=IIf(

InScope("WeekCommencingGroup"),

DateDiff("d", CDate(Parameters!AsAtSnapshot.Label), CDate(Fields!Week_Commencing.Value)),

""

)

i use this to print a date difference in the regular rows, but not in the total row. You can use the same technique for your group, and can alter your expression in your Total column.

|||

Sluggy,

Thank you so much for your answer, but I'm not sure if you understand what I'm trying to do. The totals in my matrix are from the 'subtotal' function, not from a caculated column....

Perhaps I don't understand your answer...

|||

I have a similar situation I think my shed more light on the OP's Question.

If I have a database of fruit and stores, I can easily link the returns from a dataset into a matrix and get the number of each fruit at each store, and subtotals.

Apples

Oranges

Bananas

Total

Store 1

5

3

1

9

Store 2

5

2

1

8

Store 3

4

8

4

16

Store 4

8

1

2

11

Store 5

6

7

7

20

28

21

15

64

What I want however, is some way to find the percentage of each fruit at each store.

Apples

Oranges

Bananas

Total

Store 1

5

( 56% )

3

( 33% )

1

( 11% )

9

Store 2

5

( 63% )

2

( 25% )

1

( 13% )

8

Store 3

4

( 25% )

8

( 50% )

4

( 25% )

16

Store 4

8

( 73% )

1

( 9% )

2

( 18% )

11

Store 5

6

( 30% )

7

( 35% )

7

( 35% )

20

28

( 44% )

21

( 33% )

15

( 23% )

64

This would be easy if there was a way to call the Total cell at the end of each row, (# apples in the store / store total) but if that is possible I am at a loss to find it.

|||

For the fruit store example with percent of total, you just need to take the current value sum and divide by the row total. Do that with the sum function and scope.

The additional IIF statement ensures the report doesn't puke on a divide by 0.

=IIF(Sum(Fields!DATACOLUMN.Value,"matrix1_RowGroupName")=0,0,Sum(Fields!DATACOLUMN.Value)/IIF(Sum(Fields!DATACOLUMN.Value,"matrix1_RowGroupName")=0,1,Sum(Fields!DATACOLUMN.Value,"matrix1_RowGroupName")))

Replace DATACOLUMN with your sales field
Replace "matrix1_RowGroupName" with your matrix Row name


David Leibowitz
Business Intelligence Practice Manager
MaxQ Technologies
www.maxqtech.com

|||

I tried the following:

=iif(InScope("matrix1_AtYear") and InScope("matrix1_customer"),sum(fields!count1.value),var(fields!count1.value))

The Grand total will display the Variance, however it looks at the dataset to caculate this value. I'm doing all my grouping caIculation at the report level, not at the data set level. I want it to look at the total per quarter columns and use those number to come up with a variance. For instance the first row of the matrix I displayed above, I want to see (1001-200)/1001*100 = 80 .

|||

My Matrix name is Matrix1, my Row name is MatrixRow4 and the number value is "= Count(Fields!FruitDesc.Value)"

Code Snippet

=IIF(Sum(Count(Fields!FruitDesc.Value),"MatrixRow4")=0,0,Count(Fields!FruitDesc.Value)/IIF(Sum(Count(Fields!FruitDesc.Value),"MatrixRow4")=0,1,Sum(Count(Fields!FruitDesc.Value).Value,"MatrixRow4")))

On preview the report throws:

[rsAggregateofAggregate] The Value expression for the textbox 'textbox24' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions. [rsAggregateofAggregate] The Value expression for the textbox 'textbox24' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions. [rsAggregateofAggregate] The Value expression for the textbox 'textbox24' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions. [rsInvalidAggregateScope] The Value expression for the textbox ‘textbox24’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. [rsInvalidAggregateScope] The Value expression for the textbox ‘textbox24’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. [rsInvalidAggregateScope] The Value expression for the textbox ‘textbox24’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. Build complete -- 6 errors, 0 warnings|||

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

Possible helpful answer...

|||

Rageheart,

I hope this helps you or anyone else because I had the same problem.

Instead of "MartrixRow4" you need to right click on the detail and select 'Edit Group' from the dropdown menu. Use the name that is there, not the name of the row.