2 Replies Latest reply: Nov 14, 2012 3:03 AM by Nasar-Oracle RSS

    IF/ELSE IF in OLAP DML Expression

      Is it possible to do an IF/ELSE IF clause directly within my DML Expression?
        • 1. Re: IF/ELSE IF in OLAP DML Expression
          Looks like one has to make use of "-" at the end of each line.

          Where is this operator documented?
          • 2. Re: IF/ELSE IF in OLAP DML Expression
            You maybe right. I could not find the information in the documentation where it is mentioned that the end of line character for a single line expression is '-' character.

            I did see the following in OLAP DML documentation.

            IF...THEN...ELSE command is documented in OLAP DML Reference Guide:

            +"When IF is used as an expression, the THEN and ELSE keywords must be on the same line as IF. When IF is used as a command, THEN and ELSE must be on separate lines."+

            On webpage: http://docs.oracle.com/cd/E11882_01/olap.112/e17122/dml_expression.htm#BABGJIIJ
            example 2-4 shows the following:

            testprogram = IF testtype EQ 0 -
            THEN 'program0' -
            ELSE IF testtype EQ 1 -
            THEN 'program1' -
            ELSE IF testtype EQ 2 OR testtype EQ 3 -
            THEN 'program2'
            ELSE NA