Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sum Problems Post Reply Post New Topic
Author Message
rbh123456789
Newbie
Newbie


Joined: 14 Jun 2011
Online Status: Offline
Posts: 1
Quote rbh123456789 Replybullet Topic: Sum Problems
    Posted: 14 Jun 2011 at 4:38am
CR 11.5

I have 3 fields i am summarizing in my crosstab. The columns are using a CreateDate, grouped by month.

In my crosstab i have 3 rows:
1. Total Number of Unique Cases
2. Unique cases with a Representative
3. Unique cases without a Representative

For #1, i have the summarized field in the CT performing a DistinctCount on the Cases
For #2, i have the below forumla being summarized with a DistinctCount:

//@tmp_represented
if {temp_rep_app.COMPPOID} = {temp_rep_app.REPRESENT_PSOID} then {temp_rep_app.id}

For #3, i want (#1 from above) minus (#2 from above), which would give me the difference, and display how many Unique cases were Unrepresented.

Any ideas on how to do this?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Jun 2011 at 8:42am
if you structure your report the same as the crosstab you can use te distinct count and 2 Running totals that use 2 different evaluate formulas
name=w_rep
field to summarize=temp_rep_app.id
type=distinctcount
evaluate=use a formula
{temp_rep_app.COMPPOID} = {temp_rep_app.REPRESENT_PSOID}
reset=on change of group (date permonth group)
 
name=w_o_rep
field to summarize=temp_rep_app.id
type=distinctcount
evaluate=use a formula
{temp_rep_app.COMPPOID} <> {temp_rep_app.REPRESENT_PSOID}
reset=on change of group (date permonth group)
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 20 Jun 2011 at 8:24am
maybe i think too simple but this could work
//@tmp_not_represented
if {temp_rep_app.COMPPOID} <> {temp_rep_app.REPRESENT_PSOID} then {temp_rep_app.id}
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.