Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Count only visable data Post Reply Post New Topic
Author Message
MikeSa
Newbie
Newbie
Avatar

Joined: 08 Apr 2011
Location: United States
Online Status: Offline
Posts: 3
Quote MikeSa Replybullet Topic: Count only visable data
    Posted: 09 Aug 2011 at 12:49am
I have a report in which I am suppressing data based on values of another table. I am trying to count the values in {table-c}
I am conditionally suppessing data based on values in {table-a} and or duplicate values in {table b}
If a value is a duplicate in {table-b} I do not want the value of the data in {table -c} that coresponds to be counted in the summary of {table-c} also if the value of {table-a} returns a certain value I do not want the corresponding values in be counted in {table-c}
I am suppressing the dat  but the summary keeps adding the values of the suppressed values.
I am using Crystal Reports xl
 
Hope someone can help
Thanks
Mike
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 09 Aug 2011 at 2:23am
shared variables is my solution, but running totals will work as well.  DBlank is the master of running totals, and I am sure he will chime in.
 
for shared variables they tend to come in 3's (formulas)
1 to reset the counter to 0 (may be optional)
1 to increment(I would put it in with the suppression criteria...if it is not suppressed, increment you counters
1 for each variable to display the results
 
in order they look like:
shared numbervar aCount :=0;
""  //hides the output
 
shared numbervar aCount;
if (a is true) then aCount := aCount + {table.field};
""//hides the output (unless of course you want to see the running total
 
shared numbervar aCount;
aCount
 
 
Running totals will basically automate the above.  I would assume that the offset (in this case) is that you already have logic to suppress, and you would need to repeat that logic so that the running total is accurate, whereas in this case, you could incorporate the incrementing in the logic that already exists (probably)
 
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.