Print Page | Close Window

restricting a Sum

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16127
Printed Date: 21 Apr 2025 at 1:29pm


Topic: restricting a Sum
Posted By: luluber
Subject: restricting a Sum
Date Posted: 09 Apr 2012 at 9:46pm
hey guys

sorry if this has already been answered but i couldn't see after going through

im a self taught nub using crystal reports 2009.

i want to sum up a field when a separate field is only one value and then restrict it by customer group.

i understand restricting a sum to an input in a field by doing the format of below..

SUM ({@Activity}, {VW_CUST_ORDER.NAME})

but i want to basically add another restriction

where {VW_CUST_ORDER.DESCRIPTION} = "GA67 GALLIUM CITRATE"

end result is i get an output that is the sum of {@Activity} but only for product "GA67 GALLIUM CITRATE" and its all grouped per customer.

any ideas?

thanks in advance



Replies:
Posted By: DBlank
Date Posted: 10 Apr 2012 at 4:00am
hard to say as I do not know what your @activity formula is doing but in general for this sort of thing you can use variable formulas or Running Totals with an evaluation formula.
{VW_CUST_ORDER.DESCRIPTION} = "GA67 GALLIUM CITRATE"
 
Sometimes you can also use another formula to zero out the rows you do not want to include and then sum that formula
if {VW_CUST_ORDER.DESCRIPTION} = "GA67 GALLIUM CITRATE" then @activity
 


Posted By: luluber
Date Posted: 10 Apr 2012 at 3:47pm
thanks for the reply DBlank

@Activity represents how much Activity a customer orders. this is related to nuclear medicine but the software we use outputs in a non standard unit as its old. so @Activity just converts a number.

i shall google Running totals and evalutaion formulas and see what i get.


FYI i did get it to work with the section expert record by only including values of {VW_CUST_ORDER.DESCRIPTION} field equal to "GA67 GALLIUM CITRATE". this is in a group header as the report is set up as a summary and im not using the details section at all. because its in a GH it seems to funk up the rest of the report i guess? i did not look too deeply into but it drops in pages from 110 to 60 odd when i do this.


Posted By: DBlank
Date Posted: 11 Apr 2012 at 3:44am

I am not sure I followed what you meant by including it in the section expert but I think you might have used a suppression criteria?

a word of warning that suppressing records only hides them, it does not exlcude them from totals or summary functions.


Posted By: luluber
Date Posted: 11 Apr 2012 at 10:39pm
thanks for that piece of info DBlank.

in the end i caved on doing it the way i wanted. i just made it a running total with a selection criteria of {VW_CUST_ORDER.DESCRIPTION} = "GA67 GALLIUM CITRATE" and moved the output to the footer.

apparently you can set global variables to make the output appear in a header but that got me fairly lost.



Print Page | Close Window