August 17, 2007, 12:14 PM
dbCompound 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
Leahquote:
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?
August 17, 2007, 12:48 PM
dbRatingY 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
dbquote:
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
PiipsterI 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 '( )'.
August 20, 2007, 08:54 AM
jgelonaTry this:
IF EDIT(ORG_CD,'9') NE ‘B’ AND ‘2’
THEN RATINGY
ELSE IF SUPERVISOR_LEVEL NE ' '
THEN RATINGX
ELSE RATINGZ;
August 22, 2007, 04:15 PM
dbThanks everyone for your help. Your suggestions were very helpful. Everything is working as it should.