I created a Formula Field called emp_payroll_desc (#2), and the code to create each of the 16 lines for the report (grouping on LOC code) at the bottom of this page appears below. I also created 4 counters (#1) which were incremented based on the value of a table field called ‘AREA’. Depending on whether Field ‘AREA’ equaled B,C,D or E would depend on which counter would be incremented based on columns B,C,D or E. Column A is a total of columsn B,C,D,E for each row. So I first grouped on LOC code and also grouped on emp_payroll_desc in order to get totals for each line.
The problem I am having is that when I preview the report, only some of the rows are displayed for each LOC code. When I tested each IF condition (by commenting out all thief ELSE conditions), each individual line was displayed on the report with correct counts. Yet not all of the lines are displayed when I factor in all the IF and ELSES at the same time as displayed on report. It almost seems like some of the lines are being overwritten. I cannot figure out how to set up the code to display all 16 lines for each LOC code. By the way, I have tried just doing IF xxx THEN YYY; for each condition but all that does is displays the last condition ‘14. U.S. CITIZENS 65,490 669 1,971 2,269 60,581’ insteadof all 16 lines.
Can anyone help?
#1 (counters for columns B,C,D and E)
Formula field for Column B (us_terr) - code: if {AREA} = "2" then 1
Formula field for Column C (forgn_ctry) - code: if {AREA} = "3" then 1
Formula Field for Column D (dc_area) - code: if {AREA} = "4" then 1
Formula Field for Column E (out_dc_area) - code: if {AREA} = "5" then 1
#2 (emp_payroll_desc code)
IF ({WRK_SCHED} in ["I","J"] AND
{ACT_IND} = "4") THEN '16. INTERMITTENTS NOT WRKING'
ELSE IF ({WRK_SCHED} in ["I","J"] and
{ACT_IND} <> "4") then '8. INTERMITTENT'
ELSE IF {POS_TEN} IN ["P","M"] THEN '2. TOTAL IN PERM POSITIONS'
ELSE IF {WRK_SCHED} IN ["F","G","H"] THEN '3. FULL TIME'
ELSE IF ({WRK_SCHED} IN ["F","G","H"] AND
{POS_TEN} IN ["P","M"]) THEN '4. FULL TIME IN PERM POS'
ELSE IF ({WRK_SCHED} IN ["F","G","H"] AND
{APT_CAT} = "1") THEN '5. FULL TIME W/PERM APTS'
ELSE IF {WRK_SCHED} IN ["P","Q","R","S","T"] THEN '6. PART TIME'
ELSE IF ({WRK_SCHED} IN ["P","Q","R","S","T"] AND
{APT_CAT} = "1") THEN '7. PART TIME W/PERM APTS'
ELSE IF {POSN_OCCUPD_ID} = "1" THEN '9. COMPETITIVE SERVICE'
ELSE IF ({POSN_OCCUPD_ID} = "1" AND
{APT_CAT} = "1") THEN '10. WITH PERMANENT APPTS'
ELSE IF {POSN_OCCUPD_ID} in ["2","3","4"] THEN '11. EXCEPTED SERVICE & SES'
ELSE IF ({POSN_OCCUPD_ID} in ["2","3","4"] AND
{APT_CAT} = "1") THEN '12. WITH PERMANENT APPTS'
ELSE IF LEFT({CURR_PAY_PLAN},1) IN ["W","X"] THEN '13. WAGE SYSTEMS'
ELSE IF {CITIZENSHIP} IN ["8","5"] THEN '15. NONCITIZENS'
ELSE IF NOT({CITIZENSHIP} IN ["8","5"]) THEN '14. U.S. CITIZENS';
LOC CODE - ABC
_____________________________ ________ ________ ________ ________ ________
EMPLOYMENT PAYROLL TOTAL U.S. FOREIGN D.C. OUTSIDE
TURNOVER & CEILING DATA ALL AREA TERR. CNTRIES AREA D.C. AREA
- A- -B- -C- -D- -E-
1. GRAND TOTAL EMPLOYMENT 66,162 669 2,609 2,269 60,615
2. TOTAL IN PERM POSITIONS 64,890 667 2,247 2,072 59,904
3. FULL TIME 65,246 669 2,598 2,238 59,741
4. FULL TIME IN PERM POS 64,074 667 2,237 2,047 59,123
5. FULL TIME W/PERM APTS 55,436 601 1,571 1,933 51,331
6. PART TIME 905 0 11 31 863
7. PART TIME W/PERM APTS 438 0 0 12 426
8. INTERMITTENT 11 0 0 0 11
9. COMPETITIVE SERVICE 34,390 105 1,651 1,713 30,921
10. WITH PERMANENT APPTS 32,566 103 1,353 1,671 29,439
11. EXCEPTED SERVICE & SES 31,772 564 958 556 29,694
12. WITH PERMANENT APPTS 23,308 498 218 274 22,318
13. WAGE SYSTEMS 21,040 251 471 294 20,024
14. U.S. CITIZENS 65,490 669 1,971 2,269 60,581
15. NONCITIZENS 672 0 638 0 34
16. INTERMITTENTS NOT WRKING 1,147 0 2 13 1,132