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
Solved

Microsoft Report Builder 3 - Running total of non unique feilds

Posted on 2013-11-03
1
698 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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LTrim & Double Space Correction 5 40
Row insertion failed. Array 5 46
Requesting help with creating an SQL query with 2 tables 6 25
Dynamic SQL select query 4 37
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

856 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