Skip to Content
0
Former Member
May 28, 2014 at 04:50 PM

Formula help?

15 Views

My report has duplicates and I only want to sum distinct log_id's in the following formula. My sum is out of whack due to duplicate records. How can I only sum the records that meet the criteria below?

if(
{V_VWARE_OPTIME.INOUT}='I' and
{V_VWARE_OPTIME.CASE_CLASS} <> 90 and {V_VWARE_OPTIME.CASE_CLASS} <> 100 and // cases not out-of-or , special procedures
{V_VWARE_OPTIME.LOC_ID} = 1034201 and
not( {V_VWARE_OPTIME.OR_PROC_ID} IN ['2697','2699','4547','2698','2696'] ) and // not main or c-sections
not(isnull({V_VWARE_OPTIME.ROOM_IN})) and
not(isnull({V_VWARE_OPTIME.ROOM_OUT})) and
({V_VWARE_OPTIME.ROOM_IN} <> {V_VWARE_OPTIME.ROOM_OUT})
)
then

DateDiff ('n',{V_VWARE_OPTIME.ROOM_IN},{V_VWARE_OPTIME.ROOM_OUT})/60.00

else
0