1 Reply Latest reply on May 29, 2015 7:57 PM by Bill Lyons

    Tableau parameter Error In sql

    venkatesh.sharma

      Hi All,

       

      I am writing sql in oracle and table  and i my getting error in tableau

       

      and here is my sql (oracle), I need to write this sql in database only only in tableau

       

      case

      when  <Parameters.Nonco>='Average' and (avg(round(crf.crffrm-sv.sv))OVER (PARTITION BY subjid )> <Parameters.CR>)

      then 1

      else 0

      when <Parameters.Nonco>='Max' and (max(round(crf.crffrm-sv.sv))OVER (PARTITION BY subjid )> <Parameters.CR>)

      then 1

      else 0

      when <Parameters.Nonco>='Min' and( min(round(crf.crffrm-sv.sv))OVER (PARTITION BY subjid )> <Parameters.CR>)

      then 1

      else 0

      when <Parameters.Nonco>='Median' and (median(round(crf.crffrm-sv.sv))OVER (PARTITION BY subjid )> <Parameters.CR>)

      then 1

      else 0

       

       

       

      It says "invalid operator" in tableau can some help me out.

      How to debug

        • 1. Re: Tableau parameter Error In sql
          Bill Lyons

          I'm not an Oracle expert, but in general, here are some things I would examine:

          • nesting of parentheses
          • I don't see an "end" - I don't know if that is required in Oracle, but it is in SQL Server and Tableau
          • Again, I don't know Oracle, but in every other language/environment I have worked in, with a Case statement has multiple "when/then"s and only one "else." I see several "else"es. Is that normal for Oracle?
          • Have you tried that query in an Oracle environment?

           

          I apologize if none of this is of any help.