Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: grouping based on range of rates Post Reply Post New Topic
Author Message
rnareshk
Newbie
Newbie
Avatar

Joined: 19 Jul 2007
Location: India
Online Status: Offline
Posts: 30
Quote rnareshk Replybullet Topic: grouping based on range of rates
    Posted: 25 Sep 2007 at 3:17am
Hi Everyone,
 
I have a query, please someone help
 
I have to display rate grouping on the rage given by the user.
In detail:
 
The input parameters are FromRate,ToRate and margin.
Example, if I give FromRate as 10, ToRate as 200 and margin as 50 , i need groupings like below:
 
10 - 59
60 - 109
110 - 159
160 - 200
 
I hope you understood my query. Please helpme.
Thank You,
Naresh.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 25 Sep 2007 at 10:48am
You need to create a formula which returns a group number based on the parameters. Then create a group using that formula field. Here is a close proximity to what you would need (you'll have to test and tweak it to make it perfect):
NumberVar Group;
NumberVar Counter;
Counter := FromRate;
Group := 0;
While Counter<ToRate Do
{
        //Incrementing to move to the next group
        Counter := Counter + Margin;
        Group := Group + 1;
    //If we found the group, then exit the loop by maximizing the counter
    If {table.field}<Counter Then
        Counter := 99999;
}
//Return the group number
Group;




Edited by BrianBischof - 25 Sep 2007 at 10:49am
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.