Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sum of Grouped Distinct Counts Post Reply Post New Topic
Author Message
tpreston
Newbie
Newbie


Joined: 26 Jan 2011
Online Status: Offline
Posts: 7
Quote tpreston Replybullet Topic: Sum of Grouped Distinct Counts
    Posted: 04 Sep 2019 at 12:39pm
This report uses a TopN sort grouped by Company. It gathers a distinct count of unique units rented to that company.

So...
  • If Company A rents Unit 100, the distinct unit count is 1.

  • If Company A rents Unit 100, returns it, and later rents it again, the distinct unit count remains 1.

  • If Company A rents Unit 100, returns it (or doesn't), and later rents unit 101, the distinct unit count becomes 2.


These scenarios are all correct and working fine. The problem I'm having is in totaling the distinct count. I'm attempting to total the distinct count results using a Running Total Field in the report summary.

An example of the problem occurs when Company A rents Unit 100, returns it, and Company B later rents the same unit.

Using that scenario, the group counts for each company are correct but the total for all companies (the report summary) is 1 when it should be 2.

I know this is because the Running Total in the report summary is also using distinct count...but I'm not sure how to get the correct results.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Sep 2019 at 2:27am
concatenate company and unit and do a distinct count of that
IP IP Logged
tpreston
Newbie
Newbie


Joined: 26 Jan 2011
Online Status: Offline
Posts: 7
Quote tpreston Replybullet Posted: 05 Sep 2019 at 10:06am
Never thought of doing that. Simple, graceful and works perfectly. Thank you!
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.032 seconds.