Solved

How to sum only certain rows in a Crystal Report

Posted on 2010-11-23
3
910 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
[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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
A short article about problems I had with the new location API and permissions in Marshmallow

733 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