Solved

How to sum only certain rows in a Crystal Report

Posted on 2010-11-23
3
908 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VIDEO DATASOURCE Control Resize issue 2 30
SQL Insert parts by customer 12 42
Formula for calculating ROI on training 6 49
Using Third Party DLL with Access VBA 14 39
A short article about a problem I had getting the GPS LocationListener working.
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

840 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