Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to sum only certain rows in a Crystal Report

Posted on 2010-11-23
3
Medium Priority
?
923 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 36

Accepted Solution

by:
mccarl earned 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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…
Introduction to Processes

636 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