Solved

How to sum only certain rows in a Crystal Report

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

773 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