Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Percentage of distinct count Post Reply Post New Topic
Author Message
DDN66
Newbie
Newbie


Joined: 21 May 2012
Online Status: Offline
Posts: 2
Quote DDN66 Replybullet Topic: Percentage of distinct count
     Posted: 21 May 2012 at 1:49pm
How can I calculate the percentage of group#2 distinct count over group#1 distinct count? 
Eg...
Group1 Region
Group2 Customer    Distinct Count  %%%
A 25 ??? 
B 35 ???
C 40 ???
Group1 100
 
Please help.
 
Thank you.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 21 May 2012 at 11:15pm
Don't have access to Crystal right now, so it is very possible that there's an easyer way to do this, but you could create a formula like

(distinctcount({table.field}, {groupname})/distinctcount({table.field})*100 & '%'

This formula is taking the distinct count per group, deviding it by the total distinct count, multiplying it by 100, and adding the % sign mannually... But again, there might be a simpeler way to do this :)
IP IP Logged
DDN66
Newbie
Newbie


Joined: 21 May 2012
Online Status: Offline
Posts: 2
Quote DDN66 Replybullet Posted: 22 May 2012 at 8:05am
Thank you Gurbs.  It works perfectly.Thumbs%20Up
IP IP Logged
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