Solved

Microsoft Report Builder 3 - Running total of non unique feilds

Posted on 2013-11-03
1
703 Views
Last Modified: 2013-11-18
I have a report from a production system written with MS Report Builder 3 that I need to load into a ERP (with the ability to run a SQL script beforehand).  The report from the production system has some records with identifiers that are not unique and before I load into the ERP I would like to add a trailing digit to make them unique.  The trailing digit is the count of each instance (ie first instance is 1, second is 2 etc)

Data:

Record/Volume
A1/100
A2/50
A2/75
A3/200

Required data
Record/Volume
A11/100
A21/50
A22/75
A31/200

Ideally I would like to do this in MS Report Builder if possible because there are a lot of other moving parts in the current SQL script.

Is it possible to somehow get a count or the like in each row of the Report Builder report?  I have tried but am getting aggregate function errors.

Thanks
0
Comment
Question by:froodox
[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
1 Comment
 
LVL 22

Accepted Solution

by:
Nico Bontenbal earned 500 total points
ID: 39620838
You can use the RowNumber function for this. See http://technet.microsoft.com/en-us/library/ms159225%28v=sql.100%29.aspx.
Because you want to restart the count for every new value of the Record field, you need to create a group for this field, and use the name of that group as the scope for the RowNumber function. See the attached sample report. Assuming the fields are named Record and Volume, and the group for the Record field is named Record, the expression would be:
=Fields!Record.Value & RowNumber("Record") & "/" & Fields!Volume.Value

Open in new window

RowNumber.rdl
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

624 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