Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Another Suppress Question Post Reply Post New Topic
<< Prev Page  of 5 Next >>
Author Message
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 24 Feb 2010 at 12:55pm
Ok one last question?? Now that I have the information. How would I then exclude those inmates or subtract from the Total Inmates Confined?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Feb 2010 at 12:58pm
If you got the correct Running total for Inmats that are out just subtract it from a DistinctCount of all inmates. Create a formula something like:
DistinctCount(Table.inmateID})-{#RT}
Place this in the report footer.
 
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 24 Feb 2010 at 2:30pm

I was miss spoke, looking at all the inmates it still shows if the temp_out<= date param the RT still shows 1. But if the dateparam is before the Temp_out it will show 0. Somethings missing?

{Audit_Trail.FieldName} = "Temp_Out" and {Audit_Trail.BeforeValue}= "1"
and {Audit_Trail.DateStamp} <= {?date}
and
(next({Audit_Trail.FieldName})<>{Audit_Trail.FieldName}
or
(next({Audit_Trail.FieldName})={Audit_Trail.FieldName} and
next({Audit_Trail.DateStamp})>{?date}))
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Feb 2010 at 2:49pm

Make sure your Running Total Reset is set to "Never".

It should be a distinctCount of the InmateID. It will incriment by 1 everytime it finds an new 'Out' row for a unique inmate that has
the OUt row date <param and the next row (in) >param (these colored examples below) or an inmate that has a row out with a date < param and the next row is for a new inmate (these colored examples below)
 
You need not be worried about counting ROWS, you need to be worried about counting Inmates.
 
Using a Param of 2-5-10 some fake data should be something like
Inmate         Before_V  After_V      Date       Running Total
Inmate 1             0             1           1-22-10         0
Inmate 1             1             0           1-23-10         0
Inmate 1             0             1           2-4-10           1
Inmate 1             1             0           2-6-10           1 (repeated)
 
Inmate 2             0             1           1-5-10           2
 
Inmate 3             0             1           1-27-10         2 (repeated)
Inmate 3             1             0           1-29-10         2 (repeated)
 
Inmate 4             0             1           1-27-10         3
Inmate 4             1             0           2-12-10         3 (repeated)
 
Inmate 5             0             1           1-4-10           3 (repeated)
Inmate 5             1             0           1-8-10           3 (repeated)
Inmate 5            0             1            2-1-10           4
 
Note in the lines that are noted with  (repeated) are showing that the RT ignored them as they donot meet the criteria but will still have the previous RT value since is is at Reset=NEver.
Does this make sense?


Edited by DBlank - 24 Feb 2010 at 3:06pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Feb 2010 at 2:55pm
In the above example if you did a distinctcount on Inmate you would get 5.
Your RT of inmates that were out on your param date of 2-5-10 ends up being 4.
If you create your formula of DistinctCount(inmates)-RunningTotal you get 5-4=1 for you total inmates that are currently 'In' (e.g. only inmate#3 was "in" for the example)


Edited by DBlank - 24 Feb 2010 at 2:55pm
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 24 Feb 2010 at 6:23pm

That was my confusion about the numbers coming up like that. I thought I was doing something wrong. I will try that in the morning and let you know if it worked.

IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 25 Feb 2010 at 7:15am
Ok I think we are almost there but the only problem now is that it skips over an inmate. I used todays date and should have been 3 total with 3 out.
 
 DateStamp                         BeforeValue  AfterValue 
Lesa
02/08/2010 08:08:54 1                      1        0                 In_This_Facility     1
Margaret
02/12/2010 05:22:19 2                      1         0                 In_This_Facility    1
Suzann
02/24/2010 11:23:41 2                      1         0                 In_This_Facility     2

Total Inmates 3        2
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Feb 2010 at 7:20am

In the RT seelct formula in the upper right hand there is a select option that defaults to 'Exceptions For Nulls'. Did you change that to 'Default Values For Nulls'?

IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 25 Feb 2010 at 8:16am
I am not seeing that option in my Formula Workshop- RT Conditional Formula?
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 25 Feb 2010 at 8:38am
Never mind found out where it was and changed it to "Default Values for Null' and did not work.
IP IP Logged
<< Prev Page  of 5 Next >>
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.