Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Totals 1

Status
Not open for further replies.

crzycrystlgrl

Technical User
Nov 6, 2004
20
US
CR9
Okay I am trying to find a way to label an ascending order of exams. (Think medical- If you have more than 1 exam/procedure- you are the same patient with lets say 3 exams)
I would like to label them 1, 2, 3 if possible.
A running total works however- I need to be able to make assumptions on the running total in a patient formed group..and it doens't seem to be working...
Does anyone have any other ideas on what I can do?
Thanks in advance
-Cynthia
 
You need to be specific about what you mean by "make assumptions on the running total in a patient formed group" and also explain how your results are different than expected. If you need to limit your counts to records that also meet certain criteria, you can use the running total and then in the evaluation section, choose "use a formula" and add your conditions there, e.g.,

{table.field} in ["A", "B"]

This would count only the records that meet this criterion.

-LB
 
If you are grouped by patient, then create a running total counting the exams with a reset after each group

Cheers,
-LW
 
ok this is what I am trying to do...

example patientA: 3 exams were preformed. (grouped on patient)

detail looks like this:
(and the running total counts the exam sequence 1, 2, 3)

{PatientA} {ExamCode1} {#RTotal0)
{PatientA} {ExamCode2} {#RTotal0)
{PatientA} {ExamCode3} {#RTotal0)

what i need it to do then in the patient group is to look like this:

{PatientA} {@ExamCode1} {@ExamCode2} {@ExamCode3}


--the formula being
if {#RTotal0} = 1 then {ExamCode1} else " "
and
if {#RTotal0} = 2 then {ExamCode2} else " "
etc

anywho the

{@ExamCode1} {@ExamCode2} {@ExamCode3}

are all showing up blank and I need them to fill in appropriately...

Does anyone have any ideas on how I can do this?
Thanks


 
What determines the sequence of the exam codes? Adding a running total only labels the sequence. You could sort the records in the desired order and then accumulate the exam code field, by creating three formulas:

//{@reset} to be placed in the patient group header:
whileprintingrecords;
stringvar examcode := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar examcode := examcode + {table.examcode} + " ";

//{@display} to be placed in the patient group footer:
whileprintingrecords;
stringvar examcode;
trim(examcode);

Or, you might want to try using a crosstab in the patient group header or footer where you use patient as the row field, {table.examcode} as the column field, and then add it as the summary field as well, using maximum or minimum as the summary. You could then suppress the column labels and go to the customize style tab->format grid lines->uncheck "show grid lines".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top