Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping on a range of values 1

Status
Not open for further replies.

KingArthur

Programmer
Jun 29, 2001
10
GB
Hi

I'm trying to create a vary basic Crystal(XI)report that prints a list of clients with their monthly billing values, but also to group them within bands. E.G. £ <200, 201-250, 251-300 and so on.

I could group on a specified order and define a list of group names that would serve the purpose but I would prefer the group names range themselves automatically depending on the data thats being reported as some clients may have £100 a month billing whereas others may have £10,000.

I've been self teaching myself on Crystal so I applogise if I have overlooked a very simple solution or even a built in function.

Thanks

Martin
 
Try something like
Code:
if amount >= 200 then "a) Up to 200"
else
if amount >= 250  then "b) 201-250"
else...
Group on this value. You can group using any formula field that is based on just a single 'row' or detail line.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi

Thanks for your advice.

Using your idea, I ended up creating (and grouping on) a formula field (which I called 'Groupby') with the following code:-

Code:
int({Opportunity.oppo_monthlybill} / 50)*50
which gave me grouping with increments of 50

I then used a group name fomula to give a more descriptive group heading.:-
Code:
"£" + ToText({@Groupby},2,"") + " - £" + ToText({@Groupby}+49.99,2,"")

Once again, thanks for your advice. I just wished I'd asked for help earlier as it would have saved me a few hours of head scratching yesterday :-(

Regards

Martin



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top