Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subset expressed in % Post Reply Post New Topic
Author Message
paulizorama
Newbie
Newbie
Avatar

Joined: 17 Dec 2009
Location: United Kingdom
Online Status: Offline
Posts: 14
Quote paulizorama Replybullet Topic: Subset expressed in %
     Posted: 08 Feb 2010 at 4:54am
Is it possible to express a selected data subset as a percentage of the full (same ) dataset eg. the count (of the number of people with dob's in a selected range from a set of field values) as a percentage of the count (of all the people in the complete set of values)?
If so what would it look like?
I can't seem to get round the fact that the same set of field values needs to be used twice - but the report will not allow a single 'set of values' to exist in the report under two different select conditions!!
 
 
pauliz
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Feb 2010 at 6:11am
if you have a 2 groups layout like:
G1
  G2
 
you could use COUNT({table.field}, G2) / COUNT({table.field}, G1).  Sorry, I don't exact syntax of the group, but CR will do aggregates on groups.
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Feb 2010 at 7:51am
Or you can do a Running Total with your specific date criteria to get one count and then a Summary count on the whole set to get the value:
{#RT}%COUNT(field)
This must be in the Report footer to show the correct value.
 
Or is you do not have duplicate records you can create a formula to SUM on, for example create a formula field called "DateCount' as:
If table.Datefield in BEginDate to ENdDAte then 1 else 0
 
Now you can SUM that and use it against the Record COUNT
This can be use in the report header.
IP IP Logged
paulizorama
Newbie
Newbie
Avatar

Joined: 17 Dec 2009
Location: United Kingdom
Online Status: Offline
Posts: 14
Quote paulizorama Replybullet Posted: 08 Feb 2010 at 2:14pm
Thanks for the solution Lockwelle.
Am not working with 2 groups in this instance - but will file the solution for future reference - thanks for your time.
PA


Edited by paulizorama - 08 Feb 2010 at 2:15pm
pauliz
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Feb 2010 at 2:16pm
It will work with any number of groups, or even no groups, provided you are looking at 1 value against the report.
 
DBlank's suggestion are just another way to skin the same cat.  It's all in how you look at the data, what you need, and what CR can do.
 
IP IP Logged
paulizorama
Newbie
Newbie
Avatar

Joined: 17 Dec 2009
Location: United Kingdom
Online Status: Offline
Posts: 14
Quote paulizorama Replybullet Posted: 08 Feb 2010 at 2:20pm
Hey DBlank
Once again your the master.
I'll have to do some more practice around the use of Running Totals - but the solution using 'creating the formula to Sum on . .'  has worked perfectly.
Thanks yet again.
PA
pauliz
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