Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Top N Post Reply Post New Topic
Author Message
miamitourism
Newbie
Newbie
Avatar

Joined: 14 Jan 2011
Online Status: Offline
Posts: 24
Quote miamitourism Replybullet Topic: Top N
     Posted: 10 Dec 2013 at 6:19am
I am in need of some assistance and hope someone out there can help me!
 
Each of our company's members renews in a different month each year, and when they come up for renewal, the db creates an invoice for that member for the 1st of their renewal month.
 
Sometimes I am asked to run a report of all members and other customers who are no longer active, along with the last dues amount they were ever invoiced for, regardless of the year. Could I do this with a "Top N" summary? I couldn't specify a date range because I need the last invoice they ever received, regardless of the year in which it was generated.
 
I have a column in the invoices table, which is Invoice ID, that gets automatically assigned to each record when the invoice is created.  I know one way to achieve what I need is to say I need the highest invoice ID for each customer, but I don't know how to do that :( Would that be Top N where N is "1" based on Invoice ID? And if so, how would I insert a summary on this so that the Group Sort function would even be available?
IP IP Logged
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Posted: 10 Dec 2013 at 10:22am
I would first try to group my report by customer ID and select for inactive customers (assuming you have a field that says whether they are active or not).

Then in the details section, insert the field that shows the date of their payments and sort that field in descending order. Move the field into the group header and suppress the detail section of the report.

Now you will see only inactive members listed with the date of their last payment.

If you want only the month to show, i'm sure someone more experienced than me can help you get there!

IP IP Logged
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