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

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