Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
215 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

610 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