Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: I need a formula to compare data within a report Post Reply Post New Topic
Author Message
Paula J
Groupie
Groupie
Avatar

Joined: 22 Aug 2011
Location: United States
Online Status: Offline
Posts: 51
Quote Paula J Replybullet Topic: I need a formula to compare data within a report
    Posted: 24 Apr 2015 at 6:59am
Line     Num  Post Dt  Code  Set  Check
 1       111   5/6/13   117     1
 2       111   5/6/13   117     1
 3       111   8/3/14   174     1
 4       111   4/9/13   100     2
 5       111   5/6/13   200     2
 6       111   9/5/14   100     2
 7       222   4/1/13   117     1
 8       222   3/7/13   100     2
 9       333   5/8/13   174     1
10      333   7/4/14   175     1
 
Above is how my report looks and what I want is to create a formula for the Check field that you populate with a yes or not if...
the post dts on the 2 set is equal or greater than the post dts on any of the 1 sets if the num is the same.
So  I want a no to populate in the check field on line 4 because 4/9/13 is not greater than or equal to 5/13/13 or 8/3/14.  I want a yes to populate in the check field on line 5 because 5/6/13 is greater than or equal to 5/6/13.  I want a yes to populate in the check field on line 6 because 9/5/14 is greater than or equal to 5/6/13 and 8/3/14.
Then on to the next batch of same nums line 7 & 8.  A no would populate in the check field because 3/7/13 if not greater than or equal to 4/1/13.
It will be possible for that there is a same num in with a set 1 post dt but no set 2 post dts. Like in lines 9 & 10.  There will not be same nums with a set 2 post dt only.
Paula J
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Apr 2015 at 7:50am

is your sample data already group level data or are you displaying the detail row?

IP IP Logged
Paula J
Groupie
Groupie
Avatar

Joined: 22 Aug 2011
Location: United States
Online Status: Offline
Posts: 51
Quote Paula J Replybullet Posted: 28 Apr 2015 at 4:27am
No the report is not grouped...it is detailed.
Paula J
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Apr 2015 at 5:09am
not entirely following your logic.
but maybe this will help you
you can group on NUM
create RT called set1max (or whatever) 
as a max of Post date with an evaluate formula of table.setcheck =1
create RT called set2max (or whatever) 
reset at group level 1 
as a max of Post date with an evaluate formula of table.setcheck =2
reset at group level 1 
 
create a formula field to compare teh two running total fields to get your Y/N result per group
if #set1max >= #set1max then 'value' else 'other value'
place in group footer
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.