<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SQL query on selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036992#M942637</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try Direct Query for this, refer Qlikview help file for details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query&lt;/H1&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY&lt;/SPAN&gt; statement allows you to link tables through an &lt;A class="MCXref_0"&gt;&lt;EM&gt;ODBC&lt;/EM&gt;&lt;/A&gt; or OLE DB connection using the &lt;A class="MCXref_0" target="" title=""&gt;&lt;EM style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/EM&gt;&lt;/A&gt; function. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY&lt;/SPAN&gt; &lt;A name="kanchor544"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;DIMENSION &lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;fieldlist&lt;/SPAN&gt; &lt;STRONG&gt;[MEASURE&lt;/STRONG&gt; &lt;SPAN class="Italic"&gt;fieldlist&lt;/SPAN&gt;&lt;STRONG&gt;] [DETAIL&lt;/STRONG&gt; &lt;EM&gt;fieldlist&lt;/EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt; &lt;STRONG&gt;] [DETACH&lt;/STRONG&gt; &lt;EM&gt;fieldlist&lt;/EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;SPAN class="Bold"&gt;FROM &lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;tablelist&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[WHERE&lt;/STRONG&gt; &lt;EM&gt;where_clause&lt;/EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The DIMENSION, MEASURE, and DETAIL keywords can be used in any order.&lt;/P&gt;&lt;P&gt;The DIMENSION and FROM keyword clauses are required on all &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statements. The FROM keyword must appear before the DIMENSION keyword. &lt;/P&gt;&lt;P class="note"&gt;Note: The STALE keyword no longer exists in the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query syntax. The caching limit to the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; query results is now set by the &lt;A class="MCXref_0" href="https://community.qlik.com/" target="" title=""&gt;&lt;EM&gt;DirectCacheSeconds&lt;/EM&gt;&lt;/A&gt; script variable. &lt;/P&gt;&lt;P&gt;The fields specified directly after the &lt;SPAN class="Bold"&gt;DIMENSION&lt;/SPAN&gt; keyword are loaded in memory and can be used to create associations between in-memory and &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; data.&lt;/P&gt;&lt;P class="note"&gt;Note:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY &lt;/SPAN&gt;statement cannot contain &lt;SPAN class="Bold"&gt;DISTINCT&lt;/SPAN&gt; or &lt;SPAN class="Bold"&gt;GROUP BY&lt;/SPAN&gt; clauses.&lt;/P&gt;&lt;P&gt;Using the &lt;SPAN class="Bold"&gt;MEASURE &lt;/SPAN&gt;keyword, you can define which fields, besides the linked fields listed after the &lt;SPAN class="Bold"&gt;DIMENSION &lt;/SPAN&gt;keyword, are available in QlikView. MEASURE fields are recognized on a "meta level." MEASURE field data resides only in the database.&lt;/P&gt;&lt;P&gt;The &lt;SPAN class="Italic"&gt;tablelist&lt;/SPAN&gt; is a list of the names of tables or views in the database from which data will be loaded. Typically, it will be views that contain a JOIN performed on the database.&lt;/P&gt;&lt;P&gt;Typically, fields with discrete values that will be used as dimensions should be loaded with the DIMENSION keyword, whereas numbers that will be used in aggregations only should be selected with the MEASURE keyword. &lt;/P&gt;&lt;P&gt;DETAIL fields provide information or details, like "Comment" fields, that a user may want to display in a drill-to-details table box. DETAIL fields cannot be used in chart expressions.&lt;/P&gt;&lt;P&gt;DETACH fields are like DIMENSION fields except that association queries are not formulated when a DETACH is selected in a List Box or Chart. For example:&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query&lt;/SPAN&gt; &lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;DIMENSION A&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;MEASURE X,Y,Z&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;DETACH B,C&lt;/SPAN&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;From MySalesTable;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In this example, List Boxes for the B and C fields are grayed out; no green or white selections will show in those List Boxes. Only List Boxes or Charts with DIMENSION A are updated when selections are made.&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;In this example, a database table called TableName, containing fields Dim1, Dim2, Num1, Num2 and Num3, is used.Dim1 and Dim2 will be loaded into the QlikView dataset.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSTION Dim1, Dim2 MEASURE Num1, Num2, Num3 FROM TableName&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Dim1 and Dim2 will be available for use as dimensions. Num1, Num2 and Num3 will be available to QlikView for aggregations. Dim1 and Dim2 are also available for aggregations. The type of aggregations for which Dim1 and Dim2 can be used depends on their data types. For example, in many cases DIMENSION fields contain string data such as names or account numbers.Those fields cannot be summed, but they can be counted: &lt;SPAN style="font-family: monospace;"&gt;count(Dim1)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P class="note"&gt;Note:&lt;BR /&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statements are written directly in the Edit Script dialog box. They are not generated with the Create Select Statement dialog box the way SELECT statements are. To simplify construction of &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statements, you can generate a SELECT statement with the Create Select Statement dialog box and then edit the generated script to change it into a &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement.&lt;BR /&gt;For example, the SELECT statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;SQL SELECT &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;SalesOrderID,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;RevisionNumber,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;OrderDate,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;SubTotal&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;TaxAmt&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;FROM AdventureWorks.Sales.SalesOrderHeader;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could be changed to the following &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;DIMENSION &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;SalesOrderID,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;RevisionNumber,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;MEASURE &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;SubTotal&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;TaxAmt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;DETACH&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;OrderDate,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;FROM AdventureWorks.Sales.SalesOrderHeader;&lt;/SPAN&gt;&lt;/P&gt;&lt;H2&gt;Field lists&lt;/H2&gt;&lt;P&gt;A field list is a comma-separated list of field specifications, &lt;SPAN class="Italic"&gt;fieldname {, fieldname}&lt;/SPAN&gt;. A field specification can be a field name, in which case the same name is used for the database column name and the QlikView field name. Or a field specification can be a "field alias," in which case a database expression or column name is given a QlikView field name.&lt;/P&gt;&lt;P&gt;Field names can be either simple names or quoted names. A simple name begins with an alphabetic Unicode character and is followed by any combination of alphabetic or numeric characters or underscores. Quoted names begin with a double quotation mark and contain any sequence of characters. If a quoted name contains double quotation marks, those quotation marks are represented using two adjacent double quotation marks.&lt;/P&gt;&lt;P&gt;QlikView field names are case-sensitive. Database field names may or may not be case-sensitive, depending on the database. &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; Query preserves the case of all field identifiers and aliases. In the following example, the alias "MyState" is used internally to store the data from the database column "STATEID."&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY Dimension STATEID as MyState Measure AMOUNT from SALES_TABLE;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;This differs from the result of an SQL Select statement with an alias. If the alias is not explicitly quoted, the result contains the default case of column returned by the target database. In the following example, the SQL Select statement to an Oracle database creates "MYSTATE," with all upper case letters, as the internal QlikView alias even though the alias is specified as mixed case. The SQL Select statement uses the column name returned by the database, which in the case of Oracle is all upper case.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;SQL Select STATEID as MyState, STATENAME from STATE_TABLE;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;To avoid this behavior, use the LOAD statement to specify the alias.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;Load STATEID as MyState, STATENAME;&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;SQL Select STATEID, STATEMENT from STATE_TABLE;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;In this example, the "STATEID" column is stored internally by QlikView as "MyState."&lt;/P&gt;&lt;P&gt;Most database scalar expressions are allowed as field specifications. Function calls can also be used in field specifications. Expressions can contain constants that are boolean, numeric, or strings contained in single quotation marks (embedded single quotation marks are represented by adjacent single quotation marks).&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION SalesOrderID, RevisionNumber MEASURE SubTotal AS "Sub Total" FROM AdventureWorks.Sales.SalesOrderHeader&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION "SalesOrderID" AS "Sales Order ID" MEASURE SubTotal,TaxAmt,(SubTotal-TaxAmt) AS "Net Total" FROM AdventureWorks.Sales.SalesOrderHeader &lt;/P&gt;&lt;P style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION (2*Radius*3.14159) AS Circumference, Molecules/6.02e23 AS Moles MEASURE Num1 AS numA FROM TableName &lt;/P&gt;&lt;P style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION concat(region, 'code') AS region_code MEASURE Num1 AS NumA FROM TableName&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; does not support using aggregations in load statements. If aggregations are used, the results are unpredictable. A load statement such as the following should not be used:&lt;/P&gt;&lt;P style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION stateid, SUM(amount*7) AS MultiFirst MEASURE amount FROM sales_table&lt;/P&gt;&lt;P&gt;The SUM should not be in the load statement.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; also does not support QlikView functions in &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query statements. For example, the following specification for a DIMENSION field results in a failure when the "Mth" filed is used as a dimension in a Chart:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;month(ModifiedDate) as Mth&lt;/SPAN&gt; &lt;/P&gt;&lt;H2&gt;Native data-source syntax&lt;/H2&gt;&lt;P&gt;By design, the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement is data-source neutral for data sources that support SQL. For that reason, the same &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement can be used for different SQL databases without change. &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; generates database-appropriate queries as needed. &lt;/P&gt;&lt;P&gt;Native data-source syntax can be used when the user knows the database to be queried and wants to exploit database-specific extensions to SQL. Native data-source syntax is supported:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;As field expressions in DIMENSION and MEASURE clauses &lt;/LI&gt;&lt;LI&gt;As the content of the WHERE clause &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; Examples: &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY &lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;DIMENSION Dim1, Dim2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;MEASURE &lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;NATIVE ('X % Y') AS X_MOD_Y &lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;SPAN class="Code"&gt;FROM TableName&lt;/SPAN&gt; &lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY&lt;/SPAN&gt; &lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote" style="font-family: monospace;"&gt;&lt;P&gt;DIMENSION Dim1, Dim2 &lt;/P&gt;&lt;P&gt;MEASURE X, Y &lt;/P&gt;&lt;P&gt;FROM TableName &lt;/P&gt;&lt;P&gt;WHERE NATIVE ('EMAIL MATCHES "\*.EDU"') &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;H2&gt;Table names&lt;/H2&gt;&lt;P&gt;The database table name specified with the FROM keyword consists of one or more field names, separated by periods. Both simple and quoted names are allowed. Whether or not the table name is case-sensitive depends on the database.&lt;/P&gt;&lt;H2&gt;Where clauses&lt;/H2&gt;&lt;P&gt;The full syntax of database WHERE clauses is not defined here, but most SQL "relational expressions" are allowed, including the use of function calls, the LIKE operator for strings, IS NULL and IS NOT NULL, and IN. BETWEEN is not included.&lt;/P&gt;&lt;P&gt;NOT is a unary operator, as opposed to a modifier on certain keywords.&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;WHERE x &amp;gt; 100 AND "Region Code" IN ('south', 'west')&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;WHERE Code IS NOT NULL and Code LIKE '%prospect'&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;WHERE NOT X in (1,2,3)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;This last example cannot be written as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;WHERE X NOT in (1,2,3)&lt;/SPAN&gt; &lt;/P&gt;&lt;H2&gt;Restricted Terms&lt;/H2&gt;&lt;P&gt;The following terms are used as keywords and so cannot be used as column or field names without being quoted:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;and &lt;/LI&gt;&lt;LI&gt;as &lt;/LI&gt;&lt;LI&gt;detach &lt;/LI&gt;&lt;LI&gt;detail &lt;/LI&gt;&lt;LI&gt;dimension &lt;/LI&gt;&lt;LI&gt;distinct &lt;/LI&gt;&lt;LI&gt;from &lt;/LI&gt;&lt;LI&gt;in &lt;/LI&gt;&lt;LI&gt;is &lt;/LI&gt;&lt;LI&gt;like &lt;/LI&gt;&lt;LI&gt;measure &lt;/LI&gt;&lt;LI&gt;native &lt;/LI&gt;&lt;LI&gt;not &lt;/LI&gt;&lt;LI&gt;or &lt;/LI&gt;&lt;LI&gt;where &lt;/LI&gt;&lt;/UL&gt;&lt;H2&gt;&lt;A name="Direct_Discovery_System_Variables"&gt;&lt;/A&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; System Variables&lt;/H2&gt;&lt;P&gt;&lt;A name="kanchor545"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;A name="DirectCacheSeconds"&gt;&lt;/A&gt;DirectCacheSeconds&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can set a caching limit to the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; query results for Charts. Once this time limit is reached, QlikView Server clears the cache when new &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; queries are made. QlikView queries the source data for the selections and creates the cache again for the designated time limit. The result for each combination of selections is cached independently. That is, the cache is refreshed for each selection independently, so one selection refreshes the cache only for the fields selected, and a second selection refreshes cache for its relevant fields. If the second selection includes fields that were refreshed in the first selection, they are not updated in cache again if the caching limit has not been reached.&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; cache does not apply to Table Boxes. Table Box selections query the data source every time.&lt;/P&gt;&lt;P&gt;The limit value must be set in seconds. The default cache limit is 1800 seconds (30 minutes).&lt;/P&gt;&lt;P&gt;The value used for DirectCacheSeconds is the value set at the time the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement is executed. The value cannot be changed at runtime.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectCacheSeconds=1800&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor546"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;DirectConnectionMax&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;You can do asynchronous, parallel calls to the database by using the connection pooling capability. The load script syntax to set up the pooling capability is as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectConnectionMax=10&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The numeric setting specifies the maximum number of database connections the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; code should use while updating Sheet objects. The default setting is 1.&lt;/P&gt;&lt;P class="note"&gt;Notes:&lt;BR /&gt;Caution should be taken when setting this variable. Setting it to greater than 1 is known to cause problems when connecting to MS SQL Server.&lt;BR /&gt;In the earlier release of &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt;, this variable was named "LinkedConnectionMax" and the default was 4.&lt;/P&gt;&lt;P&gt;&lt;A name="kanchor547"&gt;&lt;/A&gt;&lt;A name="DirectDiscoveryUnicodeStrings"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;DirectUnicodeStrings&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; can support the selection of extended Unicode data by using the SQL standard format for extended character string literals (N’&amp;lt;extended string&amp;gt;’) as required by some databases (notably SQL Server). The use of this syntax can be enabled for &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; with the script variable DirectUnicodeStrings. &lt;/P&gt;&lt;P&gt;Setting this variable to 'true' will enable the use of the ANSI standard wide character marker “N” in front of the string literals. Not all databases support this standard. The default setting is 'false'.&lt;/P&gt;&lt;P&gt;&lt;A name="kanchor548"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;A name="DirectDistinctSupport"&gt;&lt;/A&gt;DirectDistinctSupport&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;When a DIMENSION field value is selected in a QlikView object, a query is generated for the source database (see &lt;A class="MCXref_0"&gt;&lt;EM&gt;Differences between &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; and In-Memory Data&lt;/EM&gt;&lt;/A&gt;). When the query requires grouping, &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; uses the DISTINCT keyword to select only unique values. Some databases, however, require the GROUP BY keyword. Set DirectDistinctSupport to "false" to generate GROUP BY instead of DISTINCT in queries for unique values.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectDistinctSupport=false&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;If DirectDistinctSupport is set to true, then DISTINCT is used. If it is not set, the default behavior is to use DISTINCT.&lt;/P&gt;&lt;H2&gt;&lt;A name="Direct_Discovery_Character_Variables"&gt;&lt;/A&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; Character Variables&lt;/H2&gt;&lt;P&gt;&lt;A name="kanchor549"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectFieldColumnDelimiter&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can set the character used as the field delimiter in &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query statements for databases that require a character other than comma as the field delimiter. The specified character must be surrounded by single quotation marks in the SET statement.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectFieldColumnDelimiter= '|'&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor550"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectStringQuoteChar&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can specify a character to use to quote strings in a generated query. The default is a single quotation mark. The specified character must be surrounded by single quotation marks in the SET statement.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectStringQuoteChar= '"'&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A name="kanchor551"&gt;&lt;/A&gt;DirectIdentifierQuoteStyle&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can specify that non-ANSI quoting of identifiers be used in generated queries. At this time, the only non-ANSI quoting available is GoogleBQ. The default is ANSI. Uppercase, lowercase, and mixed case can be used (ANSI, ansi, Ansi).&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectIdentifierQuoteStyle="GoogleBQ"&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;For example, ANSI quoting is used in the following SELECT statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;SELECT [Quarter] FROM [qvTest].[sales] GROUP BY [Quarter]&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;When DirectIdentifierQuoteStyle is set to "GoogleBQ", the SELECT statement would use quoting as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;SELECT [Quarter] FROM [qvTest.sales] GROUP BY [Quarter]&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor552"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectIdentifierQuoteChar&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can specify a character to control the quoting of identifiers in a generated query. This can be set to either one character (such as a double quotation mark) or two (such as a pair of square brackets). The default is a double quotation mark.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectIdentifierQuoteChar='YYYY-MM-DD'&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor553"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectTableBoxListThreshold&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;When &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; fields are used in a Table Box, a threshold is set to limit the number of rows displayed. The default threshold is 1000 records. The default threshold setting can be changed by setting the &lt;A name="kanchor554"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectTableBoxListThreshold&lt;/STRONG&gt; variable in the load script. For example:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectTableBoxListThreshold=5000&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The threshold setting applies only to Table Boxes that contain &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; fields. Table Boxes that contain only in-memory fields are not limited by the &lt;STRONG&gt;DirectTableBoxListThreshold&lt;/STRONG&gt; setting.&lt;/P&gt;&lt;P&gt;No fields are displayed in the Table Box until the selection has fewer records than the threshold limit. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jan 2016 08:39:31 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2016-01-21T08:39:31Z</dc:date>
    <item>
      <title>SQL query on selection</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036987#M942632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say, I have a database with following columns:&lt;/P&gt;&lt;P&gt;Country, Province, City and Population.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, I want to download from server only list of Countries and Population of these Countries and display this on bar chart.&lt;/P&gt;&lt;P&gt;When user select some Country, I want to download from the base all Provinces from this Country and Population for these Provinces, and display these data on the same bar chart. The same procedure is with selection of City.&lt;/P&gt;&lt;P&gt;Shortly, I want to implement drill-down on database data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is something like this possible in QlikView?&lt;/P&gt;&lt;P&gt;If so, could someone tell me how to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for all your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mateusz P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 13:34:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036987#M942632</guid>
      <dc:creator />
      <dc:date>2016-01-20T13:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query on selection</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036988#M942633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All your requirements are possible in Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Load all the required data into QLikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create chart objects to fulfill the user requirements with existing Qlikview objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its not easy to tell in the post how to do it. At least please post some sample data so community will help if you have any roadblocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are new to Qlikview, please get a Qlikview consultant and you can learn from him or attend Qlikview training.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 16:50:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036988#M942633</guid>
      <dc:creator />
      <dc:date>2016-01-20T16:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query on selection</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036989#M942634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I don't have any sample data yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, I can't load all data into Qlikview at once, because there could be millions of records in my database. I want to first download list of the countries, with the main script. When user click one of the country in a chart (does a selection), I want Qlikview to send another SQL query to database to get list of all provinces of the selected country. Is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mateusz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 07:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036989#M942634</guid>
      <dc:creator />
      <dc:date>2016-01-21T07:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query on selection</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036990#M942635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the following doc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3089"&gt;Extracting data from Oracle using Qlikview.docx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Explained with a example and screenshots.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siva Sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 08:09:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036990#M942635</guid>
      <dc:creator>Siva_Sankar</dc:creator>
      <dc:date>2016-01-21T08:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query on selection</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036991#M942636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, What ever you have asked, possible in Qlik..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fetch all the data from your data source into QV first, and then see this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/62755"&gt;Bar Chart - Drilled down of specific field&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4970"&gt;Creating Cycle and Drill Groups&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 08:35:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036991#M942636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-21T08:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query on selection</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036992#M942637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try Direct Query for this, refer Qlikview help file for details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query&lt;/H1&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY&lt;/SPAN&gt; statement allows you to link tables through an &lt;A class="MCXref_0"&gt;&lt;EM&gt;ODBC&lt;/EM&gt;&lt;/A&gt; or OLE DB connection using the &lt;A class="MCXref_0" target="" title=""&gt;&lt;EM style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/EM&gt;&lt;/A&gt; function. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY&lt;/SPAN&gt; &lt;A name="kanchor544"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;DIMENSION &lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;fieldlist&lt;/SPAN&gt; &lt;STRONG&gt;[MEASURE&lt;/STRONG&gt; &lt;SPAN class="Italic"&gt;fieldlist&lt;/SPAN&gt;&lt;STRONG&gt;] [DETAIL&lt;/STRONG&gt; &lt;EM&gt;fieldlist&lt;/EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt; &lt;STRONG&gt;] [DETACH&lt;/STRONG&gt; &lt;EM&gt;fieldlist&lt;/EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;SPAN class="Bold"&gt;FROM &lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;tablelist&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[WHERE&lt;/STRONG&gt; &lt;EM&gt;where_clause&lt;/EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The DIMENSION, MEASURE, and DETAIL keywords can be used in any order.&lt;/P&gt;&lt;P&gt;The DIMENSION and FROM keyword clauses are required on all &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statements. The FROM keyword must appear before the DIMENSION keyword. &lt;/P&gt;&lt;P class="note"&gt;Note: The STALE keyword no longer exists in the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query syntax. The caching limit to the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; query results is now set by the &lt;A class="MCXref_0" href="https://community.qlik.com/" target="" title=""&gt;&lt;EM&gt;DirectCacheSeconds&lt;/EM&gt;&lt;/A&gt; script variable. &lt;/P&gt;&lt;P&gt;The fields specified directly after the &lt;SPAN class="Bold"&gt;DIMENSION&lt;/SPAN&gt; keyword are loaded in memory and can be used to create associations between in-memory and &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; data.&lt;/P&gt;&lt;P class="note"&gt;Note:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY &lt;/SPAN&gt;statement cannot contain &lt;SPAN class="Bold"&gt;DISTINCT&lt;/SPAN&gt; or &lt;SPAN class="Bold"&gt;GROUP BY&lt;/SPAN&gt; clauses.&lt;/P&gt;&lt;P&gt;Using the &lt;SPAN class="Bold"&gt;MEASURE &lt;/SPAN&gt;keyword, you can define which fields, besides the linked fields listed after the &lt;SPAN class="Bold"&gt;DIMENSION &lt;/SPAN&gt;keyword, are available in QlikView. MEASURE fields are recognized on a "meta level." MEASURE field data resides only in the database.&lt;/P&gt;&lt;P&gt;The &lt;SPAN class="Italic"&gt;tablelist&lt;/SPAN&gt; is a list of the names of tables or views in the database from which data will be loaded. Typically, it will be views that contain a JOIN performed on the database.&lt;/P&gt;&lt;P&gt;Typically, fields with discrete values that will be used as dimensions should be loaded with the DIMENSION keyword, whereas numbers that will be used in aggregations only should be selected with the MEASURE keyword. &lt;/P&gt;&lt;P&gt;DETAIL fields provide information or details, like "Comment" fields, that a user may want to display in a drill-to-details table box. DETAIL fields cannot be used in chart expressions.&lt;/P&gt;&lt;P&gt;DETACH fields are like DIMENSION fields except that association queries are not formulated when a DETACH is selected in a List Box or Chart. For example:&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query&lt;/SPAN&gt; &lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;DIMENSION A&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;MEASURE X,Y,Z&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;DETACH B,C&lt;/SPAN&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;From MySalesTable;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In this example, List Boxes for the B and C fields are grayed out; no green or white selections will show in those List Boxes. Only List Boxes or Charts with DIMENSION A are updated when selections are made.&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;In this example, a database table called TableName, containing fields Dim1, Dim2, Num1, Num2 and Num3, is used.Dim1 and Dim2 will be loaded into the QlikView dataset.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSTION Dim1, Dim2 MEASURE Num1, Num2, Num3 FROM TableName&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Dim1 and Dim2 will be available for use as dimensions. Num1, Num2 and Num3 will be available to QlikView for aggregations. Dim1 and Dim2 are also available for aggregations. The type of aggregations for which Dim1 and Dim2 can be used depends on their data types. For example, in many cases DIMENSION fields contain string data such as names or account numbers.Those fields cannot be summed, but they can be counted: &lt;SPAN style="font-family: monospace;"&gt;count(Dim1)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P class="note"&gt;Note:&lt;BR /&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statements are written directly in the Edit Script dialog box. They are not generated with the Create Select Statement dialog box the way SELECT statements are. To simplify construction of &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statements, you can generate a SELECT statement with the Create Select Statement dialog box and then edit the generated script to change it into a &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement.&lt;BR /&gt;For example, the SELECT statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;SQL SELECT &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;SalesOrderID,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;RevisionNumber,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;OrderDate,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;SubTotal&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;TaxAmt&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;FROM AdventureWorks.Sales.SalesOrderHeader;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could be changed to the following &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;DIMENSION &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;SalesOrderID,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;RevisionNumber,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;MEASURE &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;SubTotal&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;TaxAmt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;DETACH&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;OrderDate,&lt;/SPAN&gt;&lt;BR style="font-family: monospace;" /&gt;&lt;SPAN style="font-family: monospace;"&gt;FROM AdventureWorks.Sales.SalesOrderHeader;&lt;/SPAN&gt;&lt;/P&gt;&lt;H2&gt;Field lists&lt;/H2&gt;&lt;P&gt;A field list is a comma-separated list of field specifications, &lt;SPAN class="Italic"&gt;fieldname {, fieldname}&lt;/SPAN&gt;. A field specification can be a field name, in which case the same name is used for the database column name and the QlikView field name. Or a field specification can be a "field alias," in which case a database expression or column name is given a QlikView field name.&lt;/P&gt;&lt;P&gt;Field names can be either simple names or quoted names. A simple name begins with an alphabetic Unicode character and is followed by any combination of alphabetic or numeric characters or underscores. Quoted names begin with a double quotation mark and contain any sequence of characters. If a quoted name contains double quotation marks, those quotation marks are represented using two adjacent double quotation marks.&lt;/P&gt;&lt;P&gt;QlikView field names are case-sensitive. Database field names may or may not be case-sensitive, depending on the database. &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; Query preserves the case of all field identifiers and aliases. In the following example, the alias "MyState" is used internally to store the data from the database column "STATEID."&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY Dimension STATEID as MyState Measure AMOUNT from SALES_TABLE;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;This differs from the result of an SQL Select statement with an alias. If the alias is not explicitly quoted, the result contains the default case of column returned by the target database. In the following example, the SQL Select statement to an Oracle database creates "MYSTATE," with all upper case letters, as the internal QlikView alias even though the alias is specified as mixed case. The SQL Select statement uses the column name returned by the database, which in the case of Oracle is all upper case.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;SQL Select STATEID as MyState, STATENAME from STATE_TABLE;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;To avoid this behavior, use the LOAD statement to specify the alias.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;Load STATEID as MyState, STATENAME;&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN style="font-family: monospace;"&gt;SQL Select STATEID, STATEMENT from STATE_TABLE;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;In this example, the "STATEID" column is stored internally by QlikView as "MyState."&lt;/P&gt;&lt;P&gt;Most database scalar expressions are allowed as field specifications. Function calls can also be used in field specifications. Expressions can contain constants that are boolean, numeric, or strings contained in single quotation marks (embedded single quotation marks are represented by adjacent single quotation marks).&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION SalesOrderID, RevisionNumber MEASURE SubTotal AS "Sub Total" FROM AdventureWorks.Sales.SalesOrderHeader&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION "SalesOrderID" AS "Sales Order ID" MEASURE SubTotal,TaxAmt,(SubTotal-TaxAmt) AS "Net Total" FROM AdventureWorks.Sales.SalesOrderHeader &lt;/P&gt;&lt;P style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION (2*Radius*3.14159) AS Circumference, Molecules/6.02e23 AS Moles MEASURE Num1 AS numA FROM TableName &lt;/P&gt;&lt;P style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION concat(region, 'code') AS region_code MEASURE Num1 AS NumA FROM TableName&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; does not support using aggregations in load statements. If aggregations are used, the results are unpredictable. A load statement such as the following should not be used:&lt;/P&gt;&lt;P style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY DIMENSION stateid, SUM(amount*7) AS MultiFirst MEASURE amount FROM sales_table&lt;/P&gt;&lt;P&gt;The SUM should not be in the load statement.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; also does not support QlikView functions in &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query statements. For example, the following specification for a DIMENSION field results in a failure when the "Mth" filed is used as a dimension in a Chart:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;month(ModifiedDate) as Mth&lt;/SPAN&gt; &lt;/P&gt;&lt;H2&gt;Native data-source syntax&lt;/H2&gt;&lt;P&gt;By design, the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement is data-source neutral for data sources that support SQL. For that reason, the same &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement can be used for different SQL databases without change. &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; generates database-appropriate queries as needed. &lt;/P&gt;&lt;P&gt;Native data-source syntax can be used when the user knows the database to be queried and wants to exploit database-specific extensions to SQL. Native data-source syntax is supported:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;As field expressions in DIMENSION and MEASURE clauses &lt;/LI&gt;&lt;LI&gt;As the content of the WHERE clause &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; Examples: &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY &lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;DIMENSION Dim1, Dim2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;MEASURE &lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;NATIVE ('X % Y') AS X_MOD_Y &lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;SPAN class="Code"&gt;FROM TableName&lt;/SPAN&gt; &lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY&lt;/SPAN&gt; &lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote" style="font-family: monospace;"&gt;&lt;P&gt;DIMENSION Dim1, Dim2 &lt;/P&gt;&lt;P&gt;MEASURE X, Y &lt;/P&gt;&lt;P&gt;FROM TableName &lt;/P&gt;&lt;P&gt;WHERE NATIVE ('EMAIL MATCHES "\*.EDU"') &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;H2&gt;Table names&lt;/H2&gt;&lt;P&gt;The database table name specified with the FROM keyword consists of one or more field names, separated by periods. Both simple and quoted names are allowed. Whether or not the table name is case-sensitive depends on the database.&lt;/P&gt;&lt;H2&gt;Where clauses&lt;/H2&gt;&lt;P&gt;The full syntax of database WHERE clauses is not defined here, but most SQL "relational expressions" are allowed, including the use of function calls, the LIKE operator for strings, IS NULL and IS NOT NULL, and IN. BETWEEN is not included.&lt;/P&gt;&lt;P&gt;NOT is a unary operator, as opposed to a modifier on certain keywords.&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;WHERE x &amp;gt; 100 AND "Region Code" IN ('south', 'west')&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;WHERE Code IS NOT NULL and Code LIKE '%prospect'&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;WHERE NOT X in (1,2,3)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;This last example cannot be written as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;WHERE X NOT in (1,2,3)&lt;/SPAN&gt; &lt;/P&gt;&lt;H2&gt;Restricted Terms&lt;/H2&gt;&lt;P&gt;The following terms are used as keywords and so cannot be used as column or field names without being quoted:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;and &lt;/LI&gt;&lt;LI&gt;as &lt;/LI&gt;&lt;LI&gt;detach &lt;/LI&gt;&lt;LI&gt;detail &lt;/LI&gt;&lt;LI&gt;dimension &lt;/LI&gt;&lt;LI&gt;distinct &lt;/LI&gt;&lt;LI&gt;from &lt;/LI&gt;&lt;LI&gt;in &lt;/LI&gt;&lt;LI&gt;is &lt;/LI&gt;&lt;LI&gt;like &lt;/LI&gt;&lt;LI&gt;measure &lt;/LI&gt;&lt;LI&gt;native &lt;/LI&gt;&lt;LI&gt;not &lt;/LI&gt;&lt;LI&gt;or &lt;/LI&gt;&lt;LI&gt;where &lt;/LI&gt;&lt;/UL&gt;&lt;H2&gt;&lt;A name="Direct_Discovery_System_Variables"&gt;&lt;/A&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; System Variables&lt;/H2&gt;&lt;P&gt;&lt;A name="kanchor545"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;A name="DirectCacheSeconds"&gt;&lt;/A&gt;DirectCacheSeconds&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can set a caching limit to the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; query results for Charts. Once this time limit is reached, QlikView Server clears the cache when new &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; queries are made. QlikView queries the source data for the selections and creates the cache again for the designated time limit. The result for each combination of selections is cached independently. That is, the cache is refreshed for each selection independently, so one selection refreshes the cache only for the fields selected, and a second selection refreshes cache for its relevant fields. If the second selection includes fields that were refreshed in the first selection, they are not updated in cache again if the caching limit has not been reached.&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; cache does not apply to Table Boxes. Table Box selections query the data source every time.&lt;/P&gt;&lt;P&gt;The limit value must be set in seconds. The default cache limit is 1800 seconds (30 minutes).&lt;/P&gt;&lt;P&gt;The value used for DirectCacheSeconds is the value set at the time the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;DIRECT&lt;/SPAN&gt; QUERY statement is executed. The value cannot be changed at runtime.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectCacheSeconds=1800&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor546"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;DirectConnectionMax&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;You can do asynchronous, parallel calls to the database by using the connection pooling capability. The load script syntax to set up the pooling capability is as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectConnectionMax=10&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The numeric setting specifies the maximum number of database connections the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; code should use while updating Sheet objects. The default setting is 1.&lt;/P&gt;&lt;P class="note"&gt;Notes:&lt;BR /&gt;Caution should be taken when setting this variable. Setting it to greater than 1 is known to cause problems when connecting to MS SQL Server.&lt;BR /&gt;In the earlier release of &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt;, this variable was named "LinkedConnectionMax" and the default was 4.&lt;/P&gt;&lt;P&gt;&lt;A name="kanchor547"&gt;&lt;/A&gt;&lt;A name="DirectDiscoveryUnicodeStrings"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;DirectUnicodeStrings&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; can support the selection of extended Unicode data by using the SQL standard format for extended character string literals (N’&amp;lt;extended string&amp;gt;’) as required by some databases (notably SQL Server). The use of this syntax can be enabled for &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; with the script variable DirectUnicodeStrings. &lt;/P&gt;&lt;P&gt;Setting this variable to 'true' will enable the use of the ANSI standard wide character marker “N” in front of the string literals. Not all databases support this standard. The default setting is 'false'.&lt;/P&gt;&lt;P&gt;&lt;A name="kanchor548"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;A name="DirectDistinctSupport"&gt;&lt;/A&gt;DirectDistinctSupport&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;When a DIMENSION field value is selected in a QlikView object, a query is generated for the source database (see &lt;A class="MCXref_0"&gt;&lt;EM&gt;Differences between &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; and In-Memory Data&lt;/EM&gt;&lt;/A&gt;). When the query requires grouping, &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; uses the DISTINCT keyword to select only unique values. Some databases, however, require the GROUP BY keyword. Set DirectDistinctSupport to "false" to generate GROUP BY instead of DISTINCT in queries for unique values.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectDistinctSupport=false&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;If DirectDistinctSupport is set to true, then DISTINCT is used. If it is not set, the default behavior is to use DISTINCT.&lt;/P&gt;&lt;H2&gt;&lt;A name="Direct_Discovery_Character_Variables"&gt;&lt;/A&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; Character Variables&lt;/H2&gt;&lt;P&gt;&lt;A name="kanchor549"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectFieldColumnDelimiter&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can set the character used as the field delimiter in &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct&lt;/SPAN&gt; Query statements for databases that require a character other than comma as the field delimiter. The specified character must be surrounded by single quotation marks in the SET statement.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectFieldColumnDelimiter= '|'&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor550"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectStringQuoteChar&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can specify a character to use to quote strings in a generated query. The default is a single quotation mark. The specified character must be surrounded by single quotation marks in the SET statement.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectStringQuoteChar= '"'&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A name="kanchor551"&gt;&lt;/A&gt;DirectIdentifierQuoteStyle&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can specify that non-ANSI quoting of identifiers be used in generated queries. At this time, the only non-ANSI quoting available is GoogleBQ. The default is ANSI. Uppercase, lowercase, and mixed case can be used (ANSI, ansi, Ansi).&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectIdentifierQuoteStyle="GoogleBQ"&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;For example, ANSI quoting is used in the following SELECT statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;SELECT [Quarter] FROM [qvTest].[sales] GROUP BY [Quarter]&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;When DirectIdentifierQuoteStyle is set to "GoogleBQ", the SELECT statement would use quoting as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;SELECT [Quarter] FROM [qvTest.sales] GROUP BY [Quarter]&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor552"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectIdentifierQuoteChar&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;You can specify a character to control the quoting of identifiers in a generated query. This can be set to either one character (such as a double quotation mark) or two (such as a pair of square brackets). The default is a double quotation mark.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectIdentifierQuoteChar='YYYY-MM-DD'&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A name="kanchor553"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectTableBoxListThreshold&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;When &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; fields are used in a Table Box, a threshold is set to limit the number of rows displayed. The default threshold is 1000 records. The default threshold setting can be changed by setting the &lt;A name="kanchor554"&gt;&lt;/A&gt;&lt;STRONG&gt;DirectTableBoxListThreshold&lt;/STRONG&gt; variable in the load script. For example:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;SPAN style="color: #0000ff;"&gt;SET&lt;/SPAN&gt; DirectTableBoxListThreshold=5000&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The threshold setting applies only to Table Boxes that contain &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;Direct Discovery&lt;/SPAN&gt; fields. Table Boxes that contain only in-memory fields are not limited by the &lt;STRONG&gt;DirectTableBoxListThreshold&lt;/STRONG&gt; setting.&lt;/P&gt;&lt;P&gt;No fields are displayed in the Table Box until the selection has fewer records than the threshold limit. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 08:39:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036992#M942637</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2016-01-21T08:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query on selection</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036993#M942638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But it is not suggested, it will have performance issues.&amp;nbsp; Instead you can load all the required data, if you required you can increase the reload frequency so that you always have latest data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 08:40:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036993#M942638</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2016-01-21T08:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query on selection</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036994#M942639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Mateusz P&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You have asked the question that is linked to a feature of Qlik View to work on Big Data called "Direct-Discovery".Though you can access Bigdata with out loading all the files to the In-memory of Qlik View there are many draw backs of this feature like you cant do&lt;EM&gt; SET ANALYSIS ,direct discovery measures and detail fields are not supported on global search&lt;SPAN style="color: #000000; font-size: 32px; font-family: Arial;"&gt;.&lt;/SPAN&gt;&lt;/EM&gt; so,it is always preferable to lad all the data and process it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 10:09:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-query-on-selection/m-p/1036994#M942639</guid>
      <dc:creator />
      <dc:date>2016-01-21T10:09:29Z</dc:date>
    </item>
  </channel>
</rss>

