EQL requests in the Conversation Service

A request made with the Conversation Web Service can include statements in EQL.

The Conversation Service's EQLConfig type lets you make queries using EQL statements.

Consider the following EQL statement:
RETURN SalesTransactions AS SELECT SUM(FactSales_SalesAmount)
WHERE (DimDate_FiscalYear=2008) AS Sales2008,
SUM(FactSales_SalesAmount)
WHERE (DimDate_FiscalYear=2007) AS Sales2007,
((Sales2008-Sales2007)/Sales2007 * 100) AS pctChange,
COUNTDISTINCT(FactSales_SalesOrderNumber)
AS TransactionCount
GROUP
To send it for processing to the Oracle Endeca Server, use the EQLConfig summarization type, including the statement inside the EQLQueryString element, as in this example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:ns="http://www.endeca.com/MDEX/conversation/3/0"
  xmlns:typ="http://www.endeca.com/MDEX/lql_parser/types">
<soapenv:Header/>
<soapenv:Body>
 <ns:Request>
 <ns:Language>en</ns:Language>
  <ns:State/>
   <ns:EQLConfig Id="EQLRequest"
     <ns:EQLQueryString>
      RETURN SalesTransactions AS SELECT SUM(FactSales_SalesAmount)
      WHERE (DimDate_FiscalYear=2008) AS Sales2008,
      SUM(FactSales_SalesAmount) WHERE (DimDate_FiscalYear=2007) AS Sales2007,
      ((Sales2008-Sales2007)/Sales2007 * 100) AS pctChange,
      countDistinct(FactSales_SalesOrderNumber)
      AS TransactionCount 
      GROUP
     </ns:EQLQueryString>
    </ns:EQLConfig>
   </ns:Request>
  </soapenv:Body>
</soapenv:Envelope>

The contents of the EQLQueryString element must be a valid EQL statement.

The following abbreviated response returned from the Conversation Web Service contains the calculated results of the EQL statements:
<cs:EQL Id="EQLRequest">
 <cs:ResultRecords NumRecords="1" Name="SalesTransactions">
  <cs:DimensionHierarchy/>
   <cs:AttributeMetadata name="Sales2007" type="mdex:double"/>
   <cs:AttributeMetadata name="Sales2008" type="mdex:double"/>
   <cs:AttributeMetadata name="TransactionCount" type="mdex:long"/>
   <cs:AttributeMetadata name="pctChange" type="mdex:double"/>
      <cs:Record>
        <Sales2007 type="mdex:double">2.79216705182E7</Sales2007>
        <Sales2008 type="mdex:double">3.62404846965997E7</Sales2008>
        <TransactionCount type="mdex:long">3796</TransactionCount>
        <pctChange type="mdex:double">29.793397114178</pctChange>
     </cs:Record>
   </cs:ResultRecords>
 </cs:ContentElement>
Note: This example shows only one of the ways to use EQL statements in Conversation Web Service requests. Typically, requests also include State and Operator elements that define the navigation state. In your EQL statement, you can select from this navigation state using the FROM clause.

Language ID for parsing error messages

The Request complex type has an optional Language element that sets the language for error messages that result from EQL parsing. The supported languages and their corresponding language IDs are:
  • Chinese (simplified): zh_CN
  • Chinese (traditional): zh_TW
  • English: en
  • French: fr
  • German: de
  • Italian: it
  • Japanese: ja
  • Korean : ko
  • Portuguese: pt
  • Spanish: es

If a language ID is not specified, then en (English) is the default.

The EQLQueryString example above shows where in the request you would specify the Language element for EQL parsing error messages.