Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: comparing lines of data Post Reply Post New Topic
Author Message
pjs65
Newbie
Newbie


Joined: 28 Jan 2014
Location: United States
Online Status: Offline
Posts: 3
Quote pjs65 Replybullet Topic: comparing lines of data
     Posted: 28 Jan 2014 at 6:42am
Hi, I am using crystal reports 9 and I'm pretty new to it. I am ultimately trying to create an output file(comma delimited) to charge an inactive customer fee.
Here would be an example of the data

#Cust#     #Acct# #LstActv#
123                 1               1/5/2005
123                 2               10/13/2013
456                 1               8/6/2012

I have grouped Cust#. I want to eliminate a customer from being feed if they have multiple accounts with at least one of them being active within a year of the current date. I am getting stuck when analyzing the multiple acct customer. Thank you in advance for any help.
IP IP Logged
NewCRuser
Newbie
Newbie


Joined: 28 Jan 2014
Online Status: Offline
Posts: 7
Quote NewCRuser Replybullet Posted: 28 Jan 2014 at 5:00pm
you may try to create two formula.
1. maximum(acct#)
2. currentdate - LstActv

insert maximum(acct#) in the detail section
in details section>select expert>suppress condition formula> if maximum(acct#)>0 and currentdate - LstActv >365 then true else false

hope this helps.
IP IP Logged
pjs65
Newbie
Newbie


Joined: 28 Jan 2014
Location: United States
Online Status: Offline
Posts: 3
Quote pjs65 Replybullet Posted: 29 Jan 2014 at 4:52am
Hi NewCRuser,
Not quite, if we look at the example above, my objective is to eliminate cust# 123 because they have at least one account that is active. When I plug in those formulas Cust# 123's account 1 would get feed.

Thanks for the suggestion.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 29 Jan 2014 at 4:58am
having just been through this, suppressing the rows on the report and then exporting to csv, will probably result in all rows being displayed....v9 might be different than XI, but it's something to consider.

I always think that a stored proc will solve issues, and I realize that not everyone knows/is allowed to create stored procs. In this type of scenario, the stored proc would be useful in that you can delete from the data the active customers before Crystal ever 'sees' it, and then you don't need the suppression formula.

looking at the suppression formulas, I would think that you would want to add the grouping condition into them...and I don't understand the max(acct#) needing to be > 0. Just having max({table.LstActv}, {table.Cust}) being < 365 days ago should be sufficient...at least that is what I would have thought

HTH
IP IP Logged
pjs65
Newbie
Newbie


Joined: 28 Jan 2014
Location: United States
Online Status: Offline
Posts: 3
Quote pjs65 Replybullet Posted: 30 Jan 2014 at 2:38am
Thanks Lockwelle, that did the trick. I was able to create the file via Access, but that was a little more cumbersome. I compared my output from CR9 to the access output and they were dead on.

Thanks everyone for the help.
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