Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Relative percentage Post Reply Post New Topic
Author Message
keithrichards
Newbie
Newbie


Joined: 30 Jun 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote keithrichards Replybullet Topic: Relative percentage
     Posted: 06 Nov 2010 at 4:49pm
Hi there,
 
Just hoping someone can assist.
 
I have a field with a bunch of numbers, lets say they range from from zero to one thousand.
 
What I am wanting to do is allocate a rating based on its relative percentage.
 
So it would work something like this, if the number falls into the 0% to 10% category then 1. If 11% to 20% then 2 - all the way up to 100%
 
So i suppose there are two steps, first determine which numbers fall into the appropriate percentage category. Then based on that allocate the rating.
 
The key thing is that I want the code to allocate the rating number based on the relative percentage. I did try using the PthPercentile function in the format below, but that didn't work.
 

If {SCIGS.Sector} = "Telecom" and

 

PthPercentile(10, {#SCIGS.ROE}) then 1

 

Else If

 

PthPercentile(20, {#SCIGS.ROE}) then 2

 
I'm not sure whether I sould create a running total and then try and get the percentage off that or use a formula? then maybe I'm not using the appropriate function?
Thanks in advance.
 
KR
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Nov 2010 at 6:55am

if you are looking to sort/group the records in a group header, then you are going to need to use a built in aggregate function.  The relative percentage is, already being done...  You should specify the {table.field} for PthPercentile to operate on, that way is will percentage correctly.

Hopefully this helps, as I have never used PthPercentile
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