Avatar of rhservan
rhservan
Flag for United States of America asked on

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

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!!
SSRSMicrosoft SQL Server

Avatar of undefined
Last Comment
Phillip Burton

8/22/2022 - Mon
Phillip Burton

Not enough information, for example,what is your data source and data set?
rhservan

ASKER
Hope this helps!
Variance.rtf
Phillip Burton

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?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
rhservan

ASKER
Yes, Actual and budget is in a Category dimension which compares Actual dollars spent to Budget Dollars spent based on the money measure signeddata.
SOLUTION
Phillip Burton

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rhservan

ASKER
I crated a column inside the group and placed  formula in there.  When I ran the report it eroded with a scope problem.
Phillip Burton

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)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
rhservan

ASKER
rhservan

ASKER
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
ASKER CERTIFIED SOLUTION
Phillip Burton

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.