Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Adding a constant to a summary field Post Reply Post New Topic
Author Message
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Topic: Adding a constant to a summary field
    Posted: 23 Nov 2010 at 9:31am
Hello,

I have a report with two groups, production source and salesman. I use a summary to calculate their revenue. For 2 of the salesman I must add a one time  amount I calculate and pass from a subreport.

Is there any way I can add this amount to the individual salesman total but still use summaries? If not I will have to use a manual summary for numerous fields that are affected.

Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 29 Nov 2010 at 3:48am
To the best of my knowledge, you can't use aggregate to sum anything not already in the data.
 
It sounds like you want something like:
shared numbervar fromSub;  //which hopefully returns 0 for the other salesmen
SUM({table.field}, {group}) + fromSub
 
 
this would be legal, and cuts out the manual summaries / tons of formulas, but will only work at the salesman group level.  You would need to modify the formula to update another variable so that higher groups have the same values. Like:
 
shared numbervar fromSub;
shared numbervar AllSub := AllSub + fromSub;
SUM({table.field}, {group}) + AllSub
 
HTH
 
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.