pulling a calculated field from two separte fields

Michael K 21 Reputation points
2020-08-28T19:17:14.03+00:00

Hello,
I have a table that is fed by a dataset. The dataset is a stored procedure that returns two lines associated with each employee. They are sorted by the indicator so line 1 is always followed by line 2. For example:

EmpID...Indicator..........Mon......Tues.....Wed.....Tot....pointValue

123456.......X....................3...............4..........4...........11
123456.......Z....................W............W.........W.........12......... .917

So the SSRS report shows the two lines for each employee. The question. I need to take the Tot from Line 1 (11) and Divide it by the Tot in line 2 (12) and display the point value in a column (pointValue) at the end of each line 2.
Is this possible?
Thanks for your time!

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,940 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lukas Yu -MSFT 5,821 Reputation points
    2020-08-31T02:49:30.433+00:00

    Hi,
    You could try in the pointValue column use expression as :

    = FormatNumber(Fields!Tot.value/Previous(Filelds!Tot.value),3)  
    

    See reference : Report Builder Functions - Previous Function

    Regards,
    Lukas


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.