Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grouping by Formula Post Reply Post New Topic
Author Message
Stanno
Newbie
Newbie
Avatar

Joined: 19 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote Stanno Replybullet Topic: Grouping by Formula
     Posted: 27 Jan 2011 at 3:55am

Dear all,

Howdy, got a query which should hopefully be a quick one.  I thought it would already have been asked here, but I couldn't find a similar query via the search, so here goes.
 
I have a formula (@AssignedWorker), correctly selecting a Worker assigned to specific clients.  Trying to choose which worker is based on three logicals, and looks roughly like this:
 
if not isnull({Review.WorkerName}) then {Review.WorkerName} else
if not isnull({Referral.WorkerName}) then {Referral.WorkerName} else
NthMostFrequent (1, {Events.WorkerName}, {Episode.Episode})
 
This is correctly finding the worker I'm looking for in each case.
 
Now, I want to group on this output.  And I can't find the reference to the formula I've created to group against (accessing the Group Expert, the formula created is not available).
 
HELP!  Pretty please. 
 
Big%20smile
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jan 2011 at 4:12am
NthMostFrequent is evaluated at Print Time which is after grouping has occurred so this formula cannot be used for grouping.

Edited by DBlank - 27 Jan 2011 at 4:12am
IP IP Logged
Stanno
Newbie
Newbie
Avatar

Joined: 19 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote Stanno Replybullet Posted: 27 Jan 2011 at 4:16am
Originally posted by DBlank

NthMostFrequent is evaluated at Print Time which is after grouping has occurred so this formula cannot be used for grouping.
 
Ahh.  That would be a problem.
 
So I need to restructure my formula.  Thanks for pointing me in the right direction.
 
Will this reason apply to all Summary fields?


Edited by Stanno - 27 Jan 2011 at 4:18am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jan 2011 at 4:18am
Based on your formula you may need to do this externally or in a command to get the value you need for grouping.
IP IP Logged
Stanno
Newbie
Newbie
Avatar

Joined: 19 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote Stanno Replybullet Posted: 27 Jan 2011 at 5:53am

I just stripped the formula back to the first two logical operations, and left the third with a blank worker... Individual offices can trace why workers aren't completing things properly.

So, many thanks!  Would you care for another jackalope?  I've got a spare marmoset here I could do with sacrificing, the bugger's gotten quite noisy of late.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jan 2011 at 5:55am
Thumbs%20Up
IP IP Logged
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