Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Sum over sum Post Reply Post New Topic
Author Message
MikeZ
Newbie
Newbie


Joined: 05 Nov 2011
Online Status: Offline
Posts: 4
Quote MikeZ Replybullet Topic: Sum over sum
    Posted: 05 Nov 2011 at 1:24pm
Good evening,
 
Hopefully you can help me!
 
I have some fields summed up bases on some conditions. These conditions include previous() and next() functions to summing this field later is not possible.
 
Therefor I have made a formula using a variable to define when to add the value or when not to
 
Then I have made a new formula which on different conditions sums up the previous formula.
 
This all works great. Only in the group footer I want to show the result of this last formula.
Because this sum is based on a variable and the formula is shown in my details records but also in my group footer it will sum the last record twice.
How can I add the condition in my formula to recognize that the current action is not in a detail record but in a group record, so it does not need to re-calculate?
 
Many thanks for your troubles!
 
Regards,
Mike
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Nov 2011 at 4:40am
create another shared variable formula to display inthe report footer
(do not use the calualting field)
// assuming it is a numbervar, replace x with whatever you named your variable
shared numbervar x;
x := x
IP IP Logged
MikeZ
Newbie
Newbie


Joined: 05 Nov 2011
Online Status: Offline
Posts: 4
Quote MikeZ Replybullet Posted: 04 Jan 2012 at 2:09am
Haha! Clap
 
Wonderful! Actually quite simple! This works off course!
 
Thank you !!
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.