Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Distinct count of summarized field Post Reply Post New Topic
Author Message
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Topic: Distinct count of summarized field
    Posted: 10 Aug 2012 at 5:09am
Hello,
 
Could someone please advise on this problem?
 
I have a report, thats grouped by CUSTOMER.
 
in the group header, I have JULY sales, AUG Sales, SEP sales , Total Sales, Level Achieved.
 
sum({julysales},customer) + sum({augsales},customer) + sum({Sep Sales},customer)

{@levelachieved};
IF {@totalsales} <150  THEN "0%"
IF {@totalsales}>= 150 AND {@totalsales}<299 THEN "1%" ELSE
IF {@totalsales}>= 300  THEN "2%"
 
 
 
I want to show the COUNT of customers achieving 0% in the report header.
 
I have wrote another formula;
{@0%achieved} and tried;
 
IF {@levelachieved}="0%" THEN {table.customer} ELSE ""
 
 
I was hoping to insert a DISTINCT COUNT on this new formula, but it dont give me the option (I'm assuming its because the {@levelachieved} field is already using a summarized formula)
 
 
can anyone suggest a work around? or help?
 
 
Thanks.
Regards,

Michael Jones
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 11 Aug 2012 at 12:44am
Can anyone help?
Regards,

Michael Jones
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 13 Aug 2012 at 5:49am
Hi
 
Crystal reports process top to bottom and left to right.  Your count should process first then it should display the value, when it is counting it will process top to bottom and it can't come back and prit the value on reprot header.
 
Work around for this issue is :
 
Insert the same report as sub report on a different report header and write a manual running total like :
 
Whileprintingrecords;  // Insert this formula in your sub report group header//
Shared numbervar x;
 
if {@yourformula} <150 then
x:=x+1;
 
Write one more formula like :
 
Whileprintingrecords; //  place this in your sub report report footer//
Shared Numbervar x;
 
 
Now in the main report Report create the following formula and place it on Report header ;
 
Whileprintingrecords;
Shared Numbervar x;
 
 
This will get the value into your main report.  You can suppress all sections of your sub report to avoide printing.
 
 
 
Thanks,
Sastry
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 14 Aug 2012 at 6:04am
erm..... I dont know what to say, other than OMG! THANKYOU EVER SO MUCH!
 
You dont know how long ive been on this.
I have tried many shared variables, sub reports, allsorts, but to no avail.
 
You have just finalized my report, that will be heavily used in my company.
 
I cannot thank-you enough.
 
It has certainly been a learning curve this one, and I now have the knowledge to implent this solution in other reports.
 
 
Sincere gratitude to you.
 
Anything i can do for you, just shout. anytime.
 
:)
 
Happy Mike.
Regards,

Michael Jones
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 14 Aug 2012 at 8:21am
Thank You Mike :)
 
 
Thanks,
Sastry
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.031 seconds.