Solved

Report Builder 3.0 Expression to calculate total "Outstanding" based on specific "Status"

Posted on 2016-10-31
3
26 Views
Last Modified: 2016-11-02
Hi,

I have a matrix report where the columns are grouped on the 'Status' field. There are 3 statuses in my data, Recalled, Returned and Transferred. I have added an expression in the "Outstanding" column to calculate the total in the "Requested" column MINUS the count in the "Status" column. I want the "Outstanding" column to calculate only the number of "Transferred". Currently the Outstanding column only take the requested number from whichever status is in the last column of the matrix. This is fine when the status is sorted A to Z, however I have been asked to show the "Transferred" in the first column. The image shows the matrix design, followed by how the 'Outstanding' is calculated off the "Transferred" when it is is the last column. The 3rd image shows how the "Outstanding" is now calculating off the 'Recalled' status, as it is the last column. I am trying to work out an expression that will show 'Requested MINUS Status' ONLY when the status is "Transferred", no matter which sort order is used.

Matrix design followed by output sorting A-Z and Z-A
Thanks in advance for any assistance you can give Experts!!

Lloyd
0
Comment
Question by:lawright17
3 Comments
 
LVL 17

Expert Comment

by:Pawan Kumar Khowal
ID: 41867910
Can you provide the expression ?
0
 
LVL 13

Accepted Solution

by:
Megan Brooks earned 500 total points
ID: 41867912
The simplest general solution I can think of is to add an integer calculated field to the dataset that has the value of the 'status' count if the status is 'transferred' and zero otherwise. When you sum the value of this new field over all the status column values in one row of report output, the result will be the the 'Transferred' value only.

Calculated field expression (call it 'TransferredOnly' or whatever you'd like):
=IIf(<test for status = transferred>, Fields!<status value field name>.Value, 0)
'Outstanding' column expression:
=Fields!<requested value field name>.Value - SUM(Fields!TransferredOnly.Value)
This will find the result no matter where 'Transferred' appears, if it appears at all, or even if it occurs more than once in a row (although I assume that it won't).
0
 

Author Closing Comment

by:lawright17
ID: 41871197
Thanks so much Megan! That has got my report showing exactly how we want it!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (http://www.experts-exchange.com/articles/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Chart-Optimization-Tips.html).  This article explained how …
Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now