Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: One distinct count on four columns Post Reply Post New Topic
Author Message
Jason5000
Newbie
Newbie


Joined: 27 Jul 2010
Location: United States
Online Status: Offline
Posts: 2
Quote Jason5000 Replybullet Topic: One distinct count on four columns
    Posted: 27 Jul 2010 at 11:42am
Hi All,
 
I'm new to CR 2008.  Is there a way to do one distinct count on four separate columns?  I can do a count of each column, but I need to weed out dates that were already counted from a prior column.  Any advice would be greatly appreciated.
 
Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jul 2010 at 12:07pm
can you explain a little more with some sample data and how it should be counted?
IP IP Logged
Jason5000
Newbie
Newbie


Joined: 27 Jul 2010
Location: United States
Online Status: Offline
Posts: 2
Quote Jason5000 Replybullet Posted: 27 Jul 2010 at 12:16pm
This is a bit of an oversimplification but basically, it looks like:
 
                    Date1            Date2         Date3            Date4
 
Event 1        7/1/10                             7/3/10
 
Event 2        7/3/10          7/4/10                             7/7/10
 
Event 3        7/3/10          7/3/10                             7/4/10
 
 
 
To look at each colum separately, I can total this file to having 7 total distinct dates (2 in Date1, 2 in Date2, 1 in Date3 and 2 in Date4).
 
What I'm needing is a distinct count that looks at all four columns.  In this case, there are only 4 distinct dates across all four columns. 
 
Any guidance you could provide is greatly appreciated.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jul 2010 at 4:29pm
hmmm, a simple crystal only solution is eluding me here.
I have taken column level data like this and used a SQL stored proc or view to convert it into row data (e.g what is now 1 row becomes 1 row with the 4 date columns converted into one column) then used that as the source which makes the distinctcount very easy.
 
You could union the table into itself 4 times to do the same type of conversion.
 
Either of these seem reasonable or doable?
Anyone else seeing a more straight forward solution?


Edited by DBlank - 27 Jul 2010 at 4:30pm
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.