AnsweredAssumed Answered

Error in NSQL Statement

Question asked by venkat1 on Jun 21, 2013
Latest reply on Jun 21, 2013 by danielbernardos
Hi ,

I have belw NSQL Statement and it works fine

@SELECT:DIM:USER_DEF:IMPLIED:resource: q.res_id || q.period_id:resperiod@
,@SELECT:DIM_PROP:USER_DEF:IMPLIED:resource:q.period_start:Periodstart@ " Based on this Value i want to change Stop Light
,@SELECT:DIM_PROP:USER_DEF:IMPLIED:resource:(CASE q.ts_status WHEN 0 THEN 'Unsubmitted' WHEN 1 THEN 'Submitted' WHEN 2 THEN 'Returned' WHEN 3 THEN 'Approved' WHEN 4 THEN 'Posted' WHEN 5 THEN 'Adjusted' ELSE 'Not Created' END):timesheet_status@
,@SELECT:DIM_PROP:USER_DEF:IMPLIED:resource:CASE WHEN q.ts_status IN (0, 1, 2, 3, 4, 5) THEN 1 ELSE 0 END:allow_link@

but i need the stop light to change based on Period Start date so i changed the below code line to

,@SELECT:DIM_PROP:USER_DEF:stoplight:resource:NVL(q.ts_status,4):stoplight@ - Orginal One works fine

i have changed it to and this is the one im having issues with

,@SELECT:DIM_PROP:USER_DEF:stoplight:resource:(CASE q.period_start when < sysdate THEN NVL(q.ts_status,9) ELSE NVL(q.ts_status,2) END):stoplight@

Can anyone tell me where is the problem

Thanks in advance