Skip to Content
avatar image
Former Member

Syntax for using the if else condition inside custom query in sap bo webi

Hi all

I have to use a custom sql in one of the report using the if else condition in where clause.Usage of else is throwing the error and if i use the ternary operator syntax(using semicolons) ,its throwing the incorrect syntax error.Please help me resolve this😕

query.png (6.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Mar 30, 2016 at 11:04 AM

    Hello Moumita,

    What is your requirement exactly may be we can tweak the logic in another way to get this done?

    Regards

    Niraj

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 30, 2016 at 12:43 PM

    Hi,

    Instead of writing custom script you can create variable for the same at report level .

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 30, 2016 at 10:49 AM

    Hi,

    try using length instead of len,

    Regards,

    Rogerio

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 30, 2016 at 12:38 PM

    Hi Moumita,

    As far as my understanding goes, IF THEN ELSE statement will not work in simple SQL.

    You will have to use CASE WHEN ELSE as a substitute. Please try and check.

    Regards,

    Yuvraj

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Moumita,

      Len() function will return a numeric value; however, you are comparing it with values in single codes i.e. string.

      Provide the values without single qoutes and check.

      Regards,

      Yuvraj