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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting in the Group 1

Status
Not open for further replies.

raja2008

Technical User
Apr 16, 2008
265
US
Crystal XI R2
Sql server 2000

I have a group based on a formula which results in 5 groups.

I have differrent details for each group.
Now my user wants to sort each group on differrent fields.

I created a formula with if then else and it didn't show up in the sorting list.

How do i do this.
 
Maybe it's me (and Monday) but it's unclear what you want to do. Do you want:

1. To Sort existing group based on some total in that group (sort assending, decending, etc.)?
2. Group on different fields based upon a Parameter?

DataDog [pc2]
If God wanted us to count in Hexadecimal, then why did he only give us A fingers?
 
Here is what i have
@GroupOrder with 5 groups in it.

Grou1:
Details: Name ID Date
Group2:
Details:Name Date Amount

Now i want to sort Group1 based on Name and Group2 based on Amount ,I hope i'm clear.
Can i do this and how.

 
You should be able to use a formula like this. Let's assume your group is on a field {table.city}:

select {table.city}//your groupfield here
case 'Boston' : {table.name}
case 'New York ' : totext({table.amount},2)
case 'Los Angeles' : totext({table.date},"yyyy-MM-dd")

Add the formula to the sort records area.

-LB
 
1. Exactly what is in the Formula " @GroupOrder"? Telling us that it has "5 groups in it" is not clear.

2. Please give examples of data and expected OUTPUT(s) of the report.

DataDog [pc2]
If God wanted us to count in Hexadecimal, then why did he only give us A fingers?
 
Hello LBass!

That's exactly what i'm looking for.
Do i have to select on the Table field,The sets of data in my group has names,So,i'm pointing to the formula @GroupOrder and giving Case on those names,Which works fine .

I have a question here:If the sort fields are not of the same data type ,will i get a error message .Or is it that the sort won't work.


Thank you.

Hello DataDog
To answer your question ,My group is based on 5 pieces of my TableField data.

Thank you to both of you for your help.
 
A select case formula is just another way of writing an if/then, and yes, they have to be of the same datatype, which was why I showed an example that converted all results to a string.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top