Creating a variable to show if patient has a particular discipline

I am trying to create a report to shows all active patients, but mark those with a certain discipline assigned (Heal at Home) . They have multiple disciplines, so if they have it first and something else next, then my fields shows false. If they have it last, then it shows true. I believe I have to use a variable, but I can't remember how to set it up and to clear it out when the next patient comes up.
LVL 2
Greg GirtenDesktop Engineer IIAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
Try this idea. No variable is needed.

Create a formula
HasHealAtHome
If ({DisiplineField} = 'Heal at Home') then
    1
Else
    0

You can then use this to mark the patient
If Sum({@HasHealAtHome},{Patientgroup}) > 0 then
    "Marked"
Else
    ""

To do it with variables and mark it in the group footer
In the group header add a formula
WhilePrintingRecords;
Global BooleanVar HasHealAtHome;
HasHealAtHome := False;
""

IN the detail section
WhilePrintingRecords;
Global BooleanVar HasHealAtHome;
If ({DisiplineField} = 'Heal at Home') then
     HasHealAtHome := True;
""
 In the group footer
WhilePrintingRecords;
Global BooleanVar HasHealAtHome;
If HasHealAtHome then
    "Marked"
Else
    ""

mlmcc
0
 
Greg GirtenDesktop Engineer IIAuthor Commented:
Thanks, I was able to take what you had and make it work.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.