Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Percentage of a Group IF. Post Reply Post New Topic
Author Message
mikevtss
Newbie
Newbie
Avatar

Joined: 04 Dec 2012
Online Status: Offline
Posts: 13
Quote mikevtss Replybullet Topic: Percentage of a Group IF.
    Posted: 09 May 2023 at 12:24pm
Hi all

Im trying to work out how I what a percent of a total is of the group.

623458 <- grouped     Total
623458   Cable 1mm     12
623458   Cable 2mm     0
623458   Cable 4mm     4
623458   Cable 7mm     0
623458   Cable 10mm    5

I need to total up the items that are 0 and display it as a percentage of that group. In this case it would be 40%.



not sure how to go about it.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 07 Sep 2023 at 12:03pm
shared variables would work...

Way too late I fear.
The basic idea is to reset the counters when the grouping changes...it looks like when 623458 changes.

The increment part would be in the details section and would be something like:

shared totCount := totCount + 1;
shared zeroCount;
if {field} = 0 then zeroCount := zeroCount + 1;

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.015 seconds.