Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Topic: Trying to use previous in a running total? Posted: 17 Jul 2013 at 7:30am
Hi
I'm trying to do the following to formula @NoUnits If IsNull({RECORDED_SERVICE.UNITS}) Then {SERVICE_STATUS.Code} else if {CLINICAL_PLACE_OF_SERVICE.Code}='AM' then '1AM' else if {CLINICAL_PLACE_OF_SERVICE.Code}='PM' and previous(cdate({RECORDED_SERVICE.STARTTIME})) = cdate({RECORDED_SERVICE.STARTTIME}) then 'AMPM' else if {CLINICAL_PLACE_OF_SERVICE.Code}='PM' and
previous(cdate({RECORDED_SERVICE.STARTTIME})) <>
cdate({RECORDED_SERVICE.STARTTIME}) then '1PM' else ToText({RECORDED_SERVICE.UNITS})
The above errors I think its got to do with previous(cdate) ?
I then want to use @no-units in a running total but getting stopped
Sorry I know its unclear... I think for now I'd like to compare the date portion of the datetime field(startime) to the previous one, then go from there..
Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Posted: 17 Jul 2013 at 7:44am
Ok so kind of hacky I did a formula with previous cdate of startime and current... If IsNull({RECORDED_SERVICE.UNITS}) Then {SERVICE_STATUS.Code} else if {CLINICAL_PLACE_OF_SERVICE.Code}='AM' then '1AM' else if {CLINICAL_PLACE_OF_SERVICE.Code}='PM' and {@previouscdatesd} = {@cdatesd} then 'AMPM' else if {CLINICAL_PLACE_OF_SERVICE.Code}='PM' and {@previouscdatesd} <> {@cdatesd} then '1PM' else ToText({RECORDED_SERVICE.UNITS})
which works but I am also trying to do a matrix like report so it has a coulum for each day of the month
name....1...2...3....4.... etc
I want to display the @No_Units for each day so I am trying a running total formula for each day
example day1 running total is
get max value of @No_Units formula = DatePart ("d",{RECORDED_SERVICE.STARTTIME}) =1 reset on grouping of startime by day
problem is I get the error .... a running total cannot refer to a printtime formula Details: @NoUnits
I asum I'm getting it from the formula I use to the the previous date..
Any ideas on other ways to do this would be grteat
Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Posted: 17 Jul 2013 at 8:03am
So if you group on name then startime and look at the data if looks like
Name Starttime code @No_units Sam Adams 6/1/13 08:00AM AM 1AM Sam Adams 6/1/13 02:45PM PM AMPM Sam Adams 6/2/13 08:00PM AM 1AM Sam Adams 6/3/13 02:45PM PM 1PM etc..
so on startime footer
if they have an amand pm code on same day then ampm if only am then 1am if only pm then 1pm
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