Print Page | Close Window

Sort based on specific field

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21508
Printed Date: 06 May 2024 at 2:35am


Topic: Sort based on specific field
Posted By: bplvid
Subject: Sort based on specific field
Date Posted: 28 May 2015 at 5:00pm
I have a report which I need to Group by type but the rows under the group should be sorted based on specific field code. from the below eg. the code field needs to be sorted in NSL,CON,RWR,TAN order within the grouping.

TYPE        DATE   NAME      CODE

Cem                   
cem                                  NSL
cem                                  CON
cem                                  RWR

Fun
Fun                                   NSL
Fun                                   CON
Fun                                   RWR
Fun                                   TAN

Class
Class                                 NSL
Class                                 RWR








Replies:
Posted By: hilfy
Date Posted: 29 May 2015 at 6:33am
Create a formula that looks something like this:

Switch(
{MyTable.Code} = 'NSL', 1,
{MyTable.Code} = 'CON', 2,
{MyTable.Code} = 'RWR', 3,
{MyTable.Code} = 'TAN', 4
true, 5
)

Go to the Sort Expert and use this formula as a sort under your group.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: bplvid
Date Posted: 01 Jun 2015 at 8:34am
That Worked. Thank you.



Print Page | Close Window