Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: cross tab to eliminate duplicated rows? Post Reply Post New Topic
Author Message
aleplgr
Newbie
Newbie


Joined: 09 Dec 2006
Online Status: Offline
Posts: 23
Quote aleplgr Replybullet Topic: cross tab to eliminate duplicated rows?
    Posted: 06 Mar 2007 at 1:02am
Hi! I have a table with 3 columns: customer id, date and $ Value in the third column.
In this table I need to eliminate duplicated customer ids keeping the one with the highest $ value, to do this I'm using a crosstab, with customer id in rows and summarizing the Value with the Max criteria.. and then exporting this to an excel file and joining it with the original file to recover the Date column because the crosstab only allows one column.
I think there should be another way to do this, filtering the maximun value and keeping all the columns but can't find it... maybe using the Maximum operator in a formula but this does not eliminate rows, maybe it does but I can't find how Ouch
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 06 Mar 2007 at 9:00am
Do you know anything about SQL? This can be done using a Command object and using SQL as your datasource. The pseudo code is:
 
SELECT CustomerId, Date, Max(field)
FROM table
GROUP BY CustomerId, Date


If you don't know SQL, then I would create two groups by the Customer Id and Date and then only show one of the group headers and not the detail rows. That would eliminate all the extra rows from being displayed.


Edited by BrianBischof - 06 Mar 2007 at 9:41am
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.