Project and Portfolio Management Practitioners Forum
cancel

PPM - use of case in a request form

Highlighted
firess
Regular Contributor.

PPM - use of case in a request form

Hi,i'm trying to use the CASE function and it fails for some reason.i want the function to look at calculated value ( risk score ) then it should populate another field with the risk meaning ,e.g if risk score is between 1 to 16 it should display " low risk'.the query is shown below,i'm not sure where i'm gettting it wrong.thanx

SELECT
CASE
WHEN '[REQ.P.RISKSCORE]' BETWEEN 1 AND 16 THEN 'Low Risk'
WHEN '[REQ.P.RISKSCORE]' BETWEEN 16 AND 45 THEN 'Medium Risk'
WHEN '[REQ.P.RISKSCORE]' BETWEEN 48 AND 150 THEN 'Medium Risk'

ELSE 'Risk Not Defined'
END,

CASE
WHEN '[REQ.VP.RISKSCORE]' BETWEEN 1 AND 16 THEN 'Low Risk'
WHEN '[REQ.VP.RISKSCORE]' BETWEEN 16 AND 45 THEN 'Medium Risk'
WHEN '[REQ.VP.RISKSCORE]' BETWEEN 48 AND 150 THEN 'Medium Risk'

ELSE 'Risk Not Defined'
END

FROM dual;
1 REPLY
firess
Regular Contributor.

Re: PPM - use of case in a request form

SELECT
CASE
WHEN '[REQ.P.RISKSCORE]' BETWEEN 1 AND 16 THEN 'Low Risk'
WHEN '[REQ.P.RISKSCORE]' BETWEEN 16 AND 45 THEN 'Medium Risk'
WHEN '[REQ.P.RISKSCORE]' BETWEEN 48 AND 150 THEN 'Medium Risk'

ELSE 'Risk Not Defined'
END,

CASE
WHEN '[REQ.VP.RISKSCORE]' BETWEEN 1 AND 15 THEN 'Low Risk'
WHEN '[REQ.VP.RISKSCORE]' BETWEEN 16 AND 45 THEN 'Medium Risk'
WHEN '[REQ.VP.RISKSCORE]' BETWEEN 48 AND 150 THEN 'Medium Risk'

ELSE 'Risk Not Defined'
END

FROM dual;