Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: CR XI Sorting on group formula Post Reply Post New Topic
Author Message
mpcrob
Newbie
Newbie
Avatar

Joined: 11 Apr 2011
Location: Netherlands
Online Status: Offline
Posts: 6
Quote mpcrob Replybullet Topic: CR XI Sorting on group formula
    Posted: 11 Apr 2011 at 4:15am
I have a report based on a SQL view on a SAP database, with this formula field @Wanneer in the detail section:
 
if {Omzet_ALL.DocDate} <= CurrentDate and {Omzet_ALL.DocDate} >= dateadd("yyyy",-1,currentdate) then 0
else if {Omzet_ALL.DocDate} <= dateadd("yyyy",-1,currentdate) and {Omzet_ALL.DocDate} >= dateadd("yyyy",-2,currentdate) then 1
else if {Omzet_ALL.DocDate} <= dateadd("yyyy",-2,currentdate) then 2
 
I'm grouping on field CC (SAP B1 CardCode).
In the same group I've put 3 other fields:
 
Diff: Distinct count of @Wanneer
Min: Minimum of @Wanneer
Max: Maximum of @Wanneer
 
The last field in the group section is @WonLost:
 
stringvar X := '';
if DistinctCount ({@Wanneer}, {Omzet_ALL.CC}) = 3 then X := 'Uit lijst';
if DistinctCount ({@Wanneer}, {Omzet_ALL.CC}) = 2 and Minimum ({@Wanneer}, {Omzet_ALL.CC}) = 0 and Maximum ({@Wanneer}, {Omzet_ALL.CC}) = 1 then X := 'Uit lijst';
if DistinctCount ({@Wanneer}, {Omzet_ALL.CC}) = 2 and Minimum ({@Wanneer}, {Omzet_ALL.CC}) = 0 and Maximum ({@Wanneer}, {Omzet_ALL.CC}) = 2 then X := 'Won';
if DistinctCount ({@Wanneer}, {Omzet_ALL.CC}) = 2 and Minimum ({@Wanneer}, {Omzet_ALL.CC}) = 1 and Maximum ({@Wanneer}, {Omzet_ALL.CC}) = 2 then X := 'Lost';
if DistinctCount ({@Wanneer}, {Omzet_ALL.CC}) = 1 and Minimum ({@Wanneer}, {Omzet_ALL.CC}) = 0 then X := 'Won';
if DistinctCount ({@Wanneer}, {Omzet_ALL.CC}) = 1 and Minimum ({@Wanneer}, {Omzet_ALL.CC}) = 1 then X := 'Lost';
if DistinctCount ({@Wanneer}, {Omzet_ALL.CC}) = 1 and Minimum ({@Wanneer}, {Omzet_ALL.CC}) = 2 then X := 'Long lost';

X
 
 
"Uit lijst" meaning it should be dropped from the list (not implemented yet).
 
The result is like this:
 
 
Now I want to sort on the field @WonLost (last column).
Is that possible?
 
Thanks for any help.
 
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.