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

How to sort by values within a field

Status
Not open for further replies.

Mack2

Instructor
Mar 12, 2003
336
US
I need to sort by values within a field. I can not do it within the dataset as it is based on a cube. I am hoping you can do it within the sort tab for the group.

A sample of the values I would like to sort by is below:

Young 5's
Kindergarten
1st grade
......

Thanks for your help!
 
Go into the group properties and select sorting

Add a field to sort on and choose A-Z

If you need to add a custom sort you have 2 options:

1: Create a Calculated Data Item along the lines of:

=iif(Fields!fieldName.Value = "Young 5's",1,iif(Fields!fieldName.Value = "1st grade",2,iif(Fields!fieldName.Value ="Kindergarten",3,99)))

And sort on that field

2: If there are too many possible items for the iif statement, create a customer code function that has a parameter to take in the field name and use a SELECT CASE statement inside that to assign your sort values

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Go into the group properties and select sorting

Add a field to sort on and choose A-Z

If you need to add a custom sort you have 2 options:

1: Create a Calculated Data Item along the lines of:

=iif(Fields!fieldName.Value = "Young 5's",1,iif(Fields!fieldName.Value = "1st grade",2,iif(Fields!fieldName.Value ="Kindergarten",3,99)))

And sort on that field

2: If there are too many possible items for the iif statement, create a custom code function that has a parameter to take in the field name and use a SELECT CASE statement inside that to assign your sort values

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top