Skip to Main Content
Spotfire Ideas Portal
Status Future Consideration
Product Spotfire
Categories Data Access
Created by Guest
Created on Sep 6, 2016

Support Commen Table Expression (WITH) in data connection custom query

Commen Table Expresion (CTE) is currently not supported in the custom query.  This would allow users to use temporary result set within the execution scope. We usually handle this with a store procedure, but its an issue on databases we are not allowed to create such or does not support it (eg HIVE)

  • Attach files
  • Guest
    Reply
    |
    Feb 16, 2024

    This Idea is from 2016 and is not implemented yet. BTW, all ideas are flagged as Future Consideration...

  • Guest
    Reply
    |
    Aug 21, 2019

    The error message you get is

    External error:
    Incorrect syntax near the keyword 'WITH'.
    Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
    Incorrect syntax near ')'.
  • Guest
    Reply
    |
    Aug 20, 2019

    I would like to do an analysis of hierarchy data, where I need to use recursive CTE. For this I would create a custom query in Spotfire, but this cannot do this at the moment, because custom query does not work with CTE.

    Example data

    Employee Line Manager
    Alfred null
    Bastian Alfred
    Chris Alfred
    Denis Bastian
    Eliot Denis

    Example query

    List of all employees reporting to Bastian (Denis, Eliot), not only direct reports (Denis).

    "Bastian" would be a parameter in the custom query.

  • Guest
    Reply
    |
    Dec 12, 2018

    I'd use it

  • Guest
    Reply
    |
    Sep 30, 2016

    It doesn't look like many Spotfire competitors support CTE's, so this would provide an advanced feature if it was supported by Spotfire.

  • Guest
    Reply
    |
    Sep 19, 2016

    A reply from Doug Johnson, Senior Technical Support Engineer (09/19/16) working on my question "Why Spotfire does not support CTE":

    "Unfortunately, Spotfire does not currently support common table expressions.

    I have linked this support request to an existing enhancement request that asks for this capability, and linked it to this support request in our database. 
    The title of the enhancement request is
      "Simplify complex queries by adding WITH statements (also known as common table expressions, or sub-query factoring clauses) to the custom query functionality."
    Our Product Management team will review it periodically as part of our release planning process.  Product Management will be able to find the enhancement request by following the link to it from this support request."

4 MERGED

Allow SQL CTE

Merged
Allow pre written queries to be used
over 7 years ago in Spotfire / Data Access 1 Future Consideration