Crystal 8.5 User
I have a subreport that contains various lab values. I only want the most recent lab to be displayed, so I have them grouped by labcode with fields in the group header and the details and group footer suppressed.
I have hit a wall trying to now display the difference between the latest lab for a specific labcode and the previous value. With the formula field in the group, the report returns the difference between groups; ie. 'BUN' - 'CREAT' vice 'BUN' - previous 'BUN'.
Can anyone offer a suggestion on how to fix this? I have included the code I am trying to use. I think it would work within the Detail section, but then I will get more than the latest lab displaying. Thanks in advance!
if {VISITLAB.CODE} = 'BUN' then
{VISITLAB.LABVALUE} - previous({VISITLAB.LABVALUE})
else
if {VISITLAB.CODE} = 'CREAT' then
{VISITLAB.LABVALUE} - previous({VISITLAB.LABVALUE})
else
if {VISITLAB.CODE} = 'HCS_CRCL' then
{VISITLAB.LABVALUE} - previous({VISITLAB.LABVALUE})
else
if {VISITLAB.CODE} = 'WBC' then
{VISITLAB.LABVALUE} - previous({VISITLAB.LABVALUE})
I have a subreport that contains various lab values. I only want the most recent lab to be displayed, so I have them grouped by labcode with fields in the group header and the details and group footer suppressed.
I have hit a wall trying to now display the difference between the latest lab for a specific labcode and the previous value. With the formula field in the group, the report returns the difference between groups; ie. 'BUN' - 'CREAT' vice 'BUN' - previous 'BUN'.
Can anyone offer a suggestion on how to fix this? I have included the code I am trying to use. I think it would work within the Detail section, but then I will get more than the latest lab displaying. Thanks in advance!
if {VISITLAB.CODE} = 'BUN' then
{VISITLAB.LABVALUE} - previous({VISITLAB.LABVALUE})
else
if {VISITLAB.CODE} = 'CREAT' then
{VISITLAB.LABVALUE} - previous({VISITLAB.LABVALUE})
else
if {VISITLAB.CODE} = 'HCS_CRCL' then
{VISITLAB.LABVALUE} - previous({VISITLAB.LABVALUE})
else
if {VISITLAB.CODE} = 'WBC' then
{VISITLAB.LABVALUE} - previous({VISITLAB.LABVALUE})