Solved

How do I create a formula column that will subtract two generated colums, from column grouping?

Posted on 2014-12-12
10
201 Views
Last Modified: 2014-12-23
I have a Matrix with a column grouping.
when running the report it creates two columns.
Column A     Column B

I need:

Column A     Column B      =Column A - Column B

I need to subtract Column B  from Column A somehow by referencing

I am having a problem with the formula where it only shows column A in the formula colum.

Please advise!!
0
Comment
Question by:rhservan
  • 5
  • 5
10 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40497890
Not enough information, for example,what is your data source and data set?
0
 

Author Comment

by:rhservan
ID: 40509005
Hope this helps!
Variance.rtf
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40509092
Are you saying that there is a varchar field called ACTUAL_BUDGET, which says "Actual" or "Budget", and there is a money field called SIGNEDDATA?
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:rhservan
ID: 40509226
Yes, Actual and budget is in a Category dimension which compares Actual dollars spent to Budget Dollars spent based on the money measure signeddata.
0
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 500 total points
ID: 40509286
Try this;

=sum(IIf([ACTUAL_BUDGET])="Actual",SIGNEDDATA,0)-sum(IIf([ACTUAL_BUDGET])="Budget",SIGNEDDATA,0)
0
 

Author Comment

by:rhservan
ID: 40511554
I crated a column inside the group and placed  formula in there.  When I ran the report it eroded with a scope problem.
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40511601
Let's start slowly then. Please try the following, and tell me which formulas give an error or an unexpected result.

=sum(SIGNEDDATA)

=sum(IIf([ACTUAL_BUDGET])="Actual",1,0)



=sum(IIf([ACTUAL_BUDGET])="Actual",SIGNEDDATA,0)
0
 

Author Comment

by:rhservan
ID: 40512118
0
 

Author Comment

by:rhservan
ID: 40512135
UPDATE - Disregard previous above communication.

I moved the parentheses to the end.  Which gave more of a result. However, still not correct. I added the column outside of the group in the design, thinking it would give a single column in the result. But not. See attached file. 2 problems still exist:

1. Need a single column for the result
2. Need the subtraction to work correctly

=sum(IIf(Fields!ACTUAL_BUDGET.Value="Budget",Fields!SIGNEDDATA.Value,0))-
sum(IIf(Fields!ACTUAL_BUDGET.Value="Actual",Fields!SIGNEDDATA.Value,0))

GIVES ME THIS:
Result.rtf
0
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40514646
It depends how you inserted the column.

Start again with two columns, then right-hand click on the second column and select Insert Column - Outside Group - Right.

You can then insert this formula in the third column.

If you find this is not working, then instead of using a Matrix, use a Table, and do the grouping/pivotting in SQL instead of leaving it to SSRS.
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

809 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