3 Replies Latest reply: May 3, 2013 6:54 AM by Suman OTN RSS

    Syntax Error in obiee 10g

    Suman OTN
      I am getting syntax error [nQSError: 27002] Near <)>: Syntax error [nQSError: 26012] . Please help me to identify for below code


      CASE WHEN Core."Dim - Date"."Year" = 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1) USING Core."Dim - Date"."Date" = VALUEOF(NQ_SESSION."R_Current_Date")) WHEN Core."Dim - Date"."Year" <> 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1) USING Core."Dim - Date"."Date" = cast(concat(cast(day(current_date) as char) ||’-’|| month(current_date) ||’-’|| cast(year(Core."Dim - Date"."Year") as char)) as date)) Else 0 End

      Many thanks.
        • 1. Re: Syntax Error in obiee 10g
          Srini VEERAVALLI
          WHEN Core."Dim - Date"."Year" 'year(current_date)' THEN
          You are missed condtion

          try to use as WHEN Core."Dim - Date"."Year" ='year(current_date)'
          or
          CASE WHEN Core."Dim - Date"."Year" = 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1) USING Core."Dim - Date"."Date" = VALUEOF(NQ_SESSION."R_Current_Date")) WHEN Core."Dim - Date"."Year"= 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1) USING Core."Dim - Date"."Date" = cast(concat(cast(day(current_date) as char) ||’-’|| month(current_date) ||’-’|| cast(year(Core."Dim - Date"."Year") as char)) as date)) Else 0 End

          Mark as correct

          Edited by: Srini VEERAVALLI on May 3, 2013 6:02 AM

          Based on given OP what was said is correct. when you are getting cast issues then you need to share values too.

          Thanks

          Edited by: Srini VEERAVALLI on May 3, 2013 2:03 PM
          • 2. Re: Syntax Error in obiee 10g
            Suman OTN
            Hi Srini,

            Its copy paste mistake, actually there is a condition available(the condition is not equal to '<>') over there. When I am pasting it is missing out.

            WHEN Core."Dim - Date"."Year" not equal to 'year(current_date)'

            Thanks.
            • 3. Re: Syntax Error in obiee 10g
              Suman OTN
              Actually everything is correct

              The problem is at cast and concat only I have gone through few posts and many of them talk about the errors. I am possibly trying all scenarios but nothing is working out

              The error message now is nQSError: 22020] Function Concat does not support non-text types.

              and my concat code is

              CAST (cast(day(current_date) as char)||'-'||month(current_date)||'-'||cast(year(Core."Dim - Date"."Date") as char) AS DATE )

              Error when tried it differently [nQSError: 27002] Near <)>: Syntax error [nQSError: 26012] .

              CAST (concat(cast(day(current_date) as char)||'-'||month(current_date)||'-'||cast(year(Core."Dim - Date"."Date") as char)) AS DATE )

              Please suggest.