?
Solved

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

Posted on 2014-12-12
10
Medium Priority
?
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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 2000 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 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

752 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