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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Greg GirtenDesktop Engineer IIAuthor Commented:
Thanks, I was able to take what you had and make it work.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.