Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Grouping by quartile? Post Reply Post New Topic
Author Message
owenh10
Newbie
Newbie


Joined: 28 May 2014
Online Status: Offline
Posts: 1
Quote owenh10 Replybullet Topic: Grouping by quartile?
     Posted: 28 May 2014 at 12:06pm
CR 2008, I have an integer field, sales amount, which I'll sort on, and I want to group it so that 25% of the results constitute one group, the next 25% the second group, etc. for a total of four groups. If I create a formula using PthPercentile, i.e.:

if {salestable.salesamount} <= (pthpercentile(25, {salestable.salesamount}) then 1 else
if {salestable.salesamount} <= (pthpercentile(50, {salestable.salesamount}) then 2 else
if {salestable.salesamount} <= (pthpercentile(75, {salestable.salesamount}) then 3 else 4

it creates it OK, but says it can't be used in a group because it's figured at runtime. Does anyone have a solution I could use? This seems like it should be a fairly simple thing to do.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 30 May 2014 at 11:26am
if you have some sql skills
you can do this in sql command


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