Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparison in Derived Field (PCPW)

Status
Not open for further replies.

swagaman

IS-IT--Management
Jan 16, 2008
10
0
0
US
I am using ADP - PCPW and would like to create a derived field to describe an employees position in the paygrade range based on the percentofrange. I couldn't figure out how to use comparisons like "percentofrange >= 67) so I resorted to the brute force method below. Is there a more elegant way to do this?

Thanks in advance for any help.

-----------------------------
@DECODE(@LEFT(REPORTS.V_EMP_PAYGRADE.PERCENTOFRANGE,1),'-','Below Minimum',

@DECODE(REPORTS.V_EMP_PAYGRADE.PERCENTOFRANGE,
0,'Below Minimum',
1,'Lowest Third - Bottom Half',
2,'Lowest Third - Bottom Half',
3,'Lowest Third - Bottom Half',
4,'Lowest Third - Bottom Half',
5,'Lowest Third - Bottom Half',
6,'Lowest Third - Bottom Half',
7,'Lowest Third - Bottom Half',
8,'Lowest Third - Bottom Half',
9,'Lowest Third - Bottom Half',
10,'Lowest Third - Bottom Half',
11,'Lowest Third - Bottom Half',
12,'Lowest Third - Bottom Half',
13,'Lowest Third - Bottom Half',
14,'Lowest Third - Bottom Half',
15,'Lowest Third - Bottom Half',
16,'Lowest Third - Bottom Half',
17,'Lowest Thrid - Top Half',
18,'Lowest Thrid - Top Half',
19,'Lowest Thrid - Top Half',
20,'Lowest Thrid - Top Half',
21,'Lowest Thrid - Top Half',
22,'Lowest Thrid - Top Half',
23,'Lowest Thrid - Top Half',
24,'Lowest Thrid - Top Half',
25,'Lowest Thrid - Top Half',
26,'Lowest Thrid - Top Half',
27,'Lowest Thrid - Top Half',
28,'Lowest Thrid - Top Half',
29,'Lowest Thrid - Top Half',
30,'Lowest Thrid - Top Half',
31,'Lowest Thrid - Top Half',
32,'Lowest Thrid - Top Half',
33,'Middle Third - Below Midpoint',
34,'Middle Third - Below Midpoint',
35,'Middle Third - Below Midpoint',
36,'Middle Third - Below Midpoint',
37,'Middle Third - Below Midpoint',
38,'Middle Third - Below Midpoint',
39,'Middle Third - Below Midpoint',
40,'Middle Third - Below Midpoint',
41,'Middle Third - Below Midpoint',
42,'Middle Third - Below Midpoint',
43,'Middle Third - Below Midpoint',
44,'Middle Third - Below Midpoint',
45,'Middle Third - Below Midpoint',
46,'Middle Third - Below Midpoint',
47,'Middle Third - Below Midpoint',
48,'Middle Third - Below Midpoint',
49,'Middle Third - Below Midpoint',
50,'Middle Third - Above Midpoint',
51,'Middle Third - Above Midpoint',
52,'Middle Third - Above Midpoint',
53,'Middle Third - Above Midpoint',
54,'Middle Third - Above Midpoint',
55,'Middle Third - Above Midpoint',
56,'Middle Third - Above Midpoint',
57,'Middle Third - Above Midpoint',
58,'Middle Third - Above Midpoint',
59,'Middle Third - Above Midpoint',
60,'Middle Third - Above Midpoint',
61,'Middle Third - Above Midpoint',
62,'Middle Third - Above Midpoint',
63,'Middle Third - Above Midpoint',
64,'Middle Third - Above Midpoint',
65,'Middle Third - Above Midpoint',
66,'Middle Third - Above Midpoint',
'Above Middle Third')
)
 
With SQL Base that is the way to do it. If you had a CASE statement (Like Oracle does) it would be better.

Specializing in ReportSmith Training and Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top