Solved

How to sum only certain rows in a Crystal Report

Posted on 2010-11-23
3
900 Views
Last Modified: 2012-06-27
I have a data set returned to a Crystal Report.  I cannot change the underlying procedure and must work with the data I get.  The report currently has a row for each share returned.  However, some shares have another row (a different asset type) for the same share.  The end-user wants to sum the two rows so that the final report has one row for the share.  So, am summing using the SEDOL (don't worry-its a trading symbol thinggy).  But I KNOW NOTHING about Crystal and am totally perplexed as to how to tell the report to ONLY sum those rows that have the same SEDOL, but yet give me all the rows that are returned as well.  That is, if I have 100 rows, but 10 of them have the  a second asset type row for the share (that is, the share row with its original asset type as well as the second asset type row), then I want to sum the 10 rows with the two asset type rows so the final report would show 90 rows. (Hope that made sense!).   I have the report grouped, but that is as far as I have gotten!
0
Comment
Question by:ssmith94015
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 34201436
It sounds like you just need to use some sort of grouping function and then just sum the groups. Note, that I don't know the specifics of Crystal but you mention that you already have it grouped, so I would be sure that there is some way to then sum values over the groups.

It doesn't need to be only summing some rows and not others. Take this simple example

SEDOL     Value
--------      -------
    A              5
    B              3
    B              4
    C              6

You just group by SEDOL and then SUM(Value) (as it would be specified in an SQL, as I mentioned I don't know how Crystal would do it). It doesn't matter that there is only one row for A and C. For A, it would just SUM(5) = 5, for C it would SUM(6) = 6 and for B it would SUM(3, 4) = 7, so you putput would be....

SEDOL     Total
--------      ------
    A              5
    B              7
    C              6

Which I believe is what you are after.
0
 

Author Comment

by:ssmith94015
ID: 34201595
Thank you, it does seem to work.  I was hoping it was along those lines as I can do this with SQL, but Crystal is foreign to me and seems VERY MESSY!
0
 

Author Closing Comment

by:ssmith94015
ID: 34201600
It is working.  I am posting anotehr question as now there is one category that can have different values (it is a text string) and I need to figure out how to tell the summed row to use only one of the two - yet keep it to one row!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
A short article about a problem I had getting the GPS LocationListener working.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

744 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

10 Experts available now in Live!

Get 1:1 Help Now