If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Case Statements

Started by elkoreano85, 08 Apr 2008 12:59:21 PM

Previous topic - Next topic

elkoreano85

I need help in creating a case statement for a derivation. The syntax DM shows is as follows:

case <expression> of
begin
<value1>: <block>
default: <block>
end


I am actually nesting it in an IF/ELSE statement therefore it looks something like this:

If (TIME_SID > 20071230 AND SUBSTR(COMPANY_CD, 1, 3) = '076') Then
   Case (MATERIAL_CAT2_CD) Of
             Begin
   '010': 0.001
             '040': 0.067
   '020': 0.032
   Default: 0.093
   End
Else If (TIME_SID < 20040126 AND SUBSTR(COMPANY_CD, 1, 3) = '076') Then
0.0465
Else
0
End If


But I get this error:

1. ERROR
DS-EXP-E001: Expression parse error at position 127;
unexpected token

If (TIME_SID > 20071230 AND SUBSTR(COMPANY_CD, 1, 3) = '076') Then
   Case (MATERIAL_CAT2_CD) Of
             Begin
   '010': >>>0.001
             '040': 0.067
   '020': 0.032
   Default: 0.093
   End
Else If (TIME_SID < 20040126 AND SUBSTR(COMPANY_CD, 1, 3) = '076') Then
0.0465
Else
0
End If


I would greatly appreciate if anyone can shed some light for me regarding this issue. Thank you very much.

elkoreano85

elkoreano85

I found out what the problem is, its a simple return statement.