Solved

How to compare column totals in an ssrs matrix?

Posted on 2008-06-19
9
2,303 Views
Last Modified: 2012-06-21
I have a matrix report that looks like this:

Product        Month1     Month2    Month3
xxx               123.45     234.56    345.67
yyy               987.65     876.54   765.43

Column group is month (there can be more than 3), row group is product (many rows)

I need a column after months 2 and 3 (etc..) with the differences:

Product        Month1     Month2   Diff 1-2  Month3  Diff-2-3
xxx               123.45     234.56    111.11  345.67    111.11
yyy               987.65     765.43    222.22  654.32    111.11

How do I set up the column with the differences in it to be hidden the 1st time, and subsequent times have the difference between the current and previous iteration?

Thanks

0
Comment
Question by:phoobar
  • 4
  • 3
9 Comments
 
LVL 15

Expert Comment

by:rob_farley
ID: 21829525
Try setting the Hidden property to be based on an expression which comes out as True if the value of the first column isn't the minimum one (based on the outer scope).

I should point out that this isn't something I've tried before...

Rob
0
 

Author Comment

by:phoobar
ID: 21831925
How do I know if it's the 1st column or it's subsequent columns?  What variable holds the column number?
0
 
LVL 15

Expert Comment

by:rob_farley
ID: 21837111
You'd need to compare it to something you know is the minimum.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:phoobar
ID: 21847628
Perhaps I'm not asking the question in the right way.  

Specifically, how do I set up the column with the differences in it?  What is the expression that will give "diff between this amount and the previous amount"?

Can it be done with custom code?  How is the custom code executed?
0
 

Author Comment

by:phoobar
ID: 21857575
Can anyone describe how custom code might be written to save the previous column's data and use it to compare to the current column?
0
 
LVL 15

Expert Comment

by:rob_farley
ID: 21862463
Reporting Services has a function called Previous which may do it for you - have a play and see.

Rob
0
 

Accepted Solution

by:
phoobar earned 0 total points
ID: 22047350
I figured out how to use code to acomplish my task.  I was using the 7 day free trial, and since I did not get answers to either of the questions I posed, I opted to cancel.  I didn't realize that I could still post a reponse, which would have been the polite thing to do.  I apologize for letting the question linger into abandonement.
0
 

Expert Comment

by:bnaict
ID: 22326958
Phoobar,
I have a similar problem. What is the solution?
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question