Question Related to Variables

Experts:

I need more help on this same issue from my previous posting on stringvar and booleanvar.

I didn't know how to reload the same questions for points so I started a new one.

My reporting data is like this:


FILENUMBER    ACTCODE   STATUSCODE      
1000                                        HS
1000                                        OE
1000                                        PF
1000                    PS
1000                    RC
1000                    RR
1000                    TR



I'm using the following formula #1 to try and assign a TRUE/FALSE based on the ACTCODE or STATUSCODE that is present. I will use a separate footer formula to COUNT the TRUE's as needed.

//formula #1
                 whileprintingrecords;
global booleanvar bTR;
global booleanvar bRR;
global booleanvar bRC;
global booleanvar bPF;


if {RLS.Status Code}= "PF" then
     global booleanvar bPF := true
else
if {RLS.Activity Code}= "RC" then
     global booleanvar bRC := true
else
if {RLS.Activity Code}= "RR" then
     global booleanvar bRR := true
else
if {RLS.Activity Code}= "TR" then
     global booleanvar bTR := true

The problem is that I cannot get this formula to calculate correctly When I use this formula this is what my data looks like.

FILENUMBER    ACTCODE   STATUSCODE    TRUE/FALSE    
1000                                        HS              
1000                                        OE
1000                                        PF               TRUE
1000                    PS
1000                    RC
1000                    RR
1000                    TR

I've tried other variations but can't seem to get the formula to assign the correct TRUE/FALSE to the correct lines. I need to assign a TRUE to only codes TR,RR,RC,PF when they are presesnt.

Thank you.
Mike
LVL 17
MIKESoftware Solutions ConsultantAsked:
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.

MIKESoftware Solutions ConsultantAuthor Commented:
I need this as a result:

FILENUMBER    ACTCODE   STATUSCODE    TRUE/FALSE    
1000                                        HS              
1000                                        OE
1000                                        PF               TRUE
1000                    PS
1000                    RC                                   TRUE
1000                    RR                                   TRUE
1000                    TR                                   TRUE

<Mike
bdreed35Commented:
Mike:

I think you are having an issue when STATUSCODE is null or ACTCODE is null.
Try your formuila this way:

//formula #1
whileprintingrecords;
global booleanvar bTR;
global booleanvar bRR;
global booleanvar bRC;
global booleanvar bPF;


if not isnull({RLS.Status Code}) and {RLS.Status Code}= "PF" then
     global booleanvar bPF := true
else
if not isnull({RLS.Activity Code}) and {RLS.Activity Code}= "RC" then
     global booleanvar bRC := true
else
if not isnull({RLS.Activity Code}) and {RLS.Activity Code}= "RR" then
     global booleanvar bRR := true
else
if not isnull({RLS.Activity Code}) and {RLS.Activity Code}= "TR" then
     global booleanvar bTR := true

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
MIKESoftware Solutions ConsultantAuthor Commented:
Ahhh ok...yes it worked.  

As ALWAYS... thank you for the help.
Mike
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.