Focal Point
Compound If Statements

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1371083242

August 17, 2007, 12:14 PM
db
Compound If Statements
How can I put the following two IF statements together to make a compound IF statement?

IF (EDIT(ORG_CD,'9') EQ ‘B’ or ‘2’) AND (SUPERVISOR_LEVEL NE ' ') THEN RATINGX
ELSE RATINGY

IF (EDIT(ORG_CD,'9') EQ ‘B’ or ‘2’) THEN RATINGZ ELSE RATINGY

I've tried the below compound statement, but it omits the record that recently moved into the 'B' or '2' org and still have a RatingY.

IF (EDIT(ORG_CD,'9') EQ ‘B’ or ‘2’) AND (SUPERVISOR_LEVEL NE ' ') THEN RATINGX
ELSE IF (EDIT(ORG_CD,'9') EQ ‘B’ or ‘2’)THEN RATINGZ ELSE RATINGY

I'm trying to define a field in the master "Rating" that will hold all the ratings regardless of the org they are in.

I welcome any and all help.

Thanks,
August 17, 2007, 12:31 PM
Leah
quote:
IF (EDIT(ORG_CD,'9') EQ ‘B’ or ‘2’) AND (SUPERVISOR_LEVEL NE ' ') THEN RATINGX
ELSE IF (EDIT(ORG_CD,'9') EQ ‘B’ or ‘2’)THEN RATINGZ ELSE RATINGY


Without knowing your data, if the person who 'moved' into 'B' or '2' and still has RATINGY, and assuming these ratings are all fields in the master, you may have to add more checks to your define, such as what is in the RATING_ field in question. Are they balnk if the other rating is still filled?


Leah
August 17, 2007, 12:48 PM
db
RatingY is the field in the master, RatingX and RatingZ are in a separate table which I joined by using a Set All=ON. RatingX is a supervisor rating, RatingZ is an IC rating, and RatingY represents both supervisors and ICs. When a person moves into the B or 2 org, they keep the Y rating until they receive a new review and vice versa.

Thanks for asking questions, it helps me think thru what I'm trying to do.
August 17, 2007, 01:03 PM
db
quote:
Originally posted by Tom Flynn:
quote:

IF (EDIT(ORG_CD,'9') EQ ‘B’ or ‘2’) AND (SUPERVISOR_LEVEL NE ' ') THEN RATINGX
ELSE RATINGY

IF (EDIT(ORG_CD,'9') EQ ‘B’ or ‘2’) THEN RATINGZ ELSE RATINGY


Thanks for your input Tom, I've tried that, but the supervisor that just moved to the 2 org shows a blank when I request a report on the 2 org.



I would:

TEST1/AXX = IF (EDIT(ORG_CD,'9') EQ ‘B’ OR ‘2’) AND (SUPERVISOR_LEVEL NE ' ') THEN RATINGX ELSE
IF (EDIT(ORG_CD,'9') EQ ‘B’ OR ‘2’) AND (SUPERVISOR_LEVEL EQ ' ') THEN RATINGZ ELSE RATINGY;

Make sure your OR is in CAPS...

August 19, 2007, 09:03 PM
Piipster
I might try this:

IF    (EDIT(ORG_CD,'9') EQ ‘B’ OR ‘2’) 
THEN  (IF (SUPERVISOR_LEVEL NE ' ') 
       THEN RATINGX 
       ELSE RATINGZ)
ELSE   RATINGY
  


Be sure to put the expression after the THEN in '( )'.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
August 20, 2007, 08:54 AM
jgelona
Try this:
IF EDIT(ORG_CD,'9') NE ‘B’ AND ‘2’
  THEN RATINGY
  ELSE IF SUPERVISOR_LEVEL NE ' '
         THEN RATINGX 
         ELSE RATINGZ;



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
August 22, 2007, 04:15 PM
db
Thanks everyone for your help. Your suggestions were very helpful. Everything is working as it should.