[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 668
  • Last Modified:

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
0
MIKE
Asked:
MIKE
  • 2
1 Solution
 
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
 
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:
Ahhh ok...yes it worked.  

As ALWAYS... thank you for the help.
Mike
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now