Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: restricting a Sum Post Reply Post New Topic
Author Message
luluber
Newbie
Newbie


Joined: 09 Apr 2012
Online Status: Offline
Posts: 4
Quote luluber Replybullet Topic: restricting a Sum
    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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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
 
IP IP Logged
luluber
Newbie
Newbie


Joined: 09 Apr 2012
Online Status: Offline
Posts: 4
Quote luluber Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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.
IP IP Logged
luluber
Newbie
Newbie


Joined: 09 Apr 2012
Online Status: Offline
Posts: 4
Quote luluber Replybullet 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.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.