<?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: Real-time analysis of new incoming transactions with DD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591056#M437864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the documentation.&lt;/P&gt;&lt;P&gt;Zeljko&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Feb 2014 13:34:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-17T13:34:41Z</dc:date>
    <item>
      <title>Real-time analysis of new incoming transactions with DD</title>
      <link>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591055#M437863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;An opening statement first: QlikView's Direct Discovery was initally made as one possible way to address Big Data by connecting to its storages. The aspect of real-time analysis was not the initial driver, so some basic assumptions were made. This article is about taking the current Direct Discovery feature behind it's concept and hence is a bit unorthodox. As newer versions will come out (&amp;gt;=QV11.2 SR6) i will revisit this article.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Direct Discovery 2.0 &lt;EM&gt;(this is the redesigned Direct Discovery since QV 11.2 SR5 only!)&lt;/EM&gt; is separating fields from an external SQL table into DIMENSION and MEASURE fields. The help file explains, that QlikView will read the distinct values of dimension fields only(!) at the execution of the reload, NOT later. This means, if new dimension members will arrive after the reload, those will not show up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is good for new fact rows to arrive for already known dimensions, like a known MachineID and some incoming machine information. But I like to &lt;STRONG&gt;achieve more&lt;/STRONG&gt; than this with Direct Discovery:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume new orders are coming in every other minute and I like to see those new transactions in QV in real-time (whenever I write about "new" orders I refer to such orders which have been created in the sql source table after the last QV reload; those are not in the memory data model). Yes, I need the unique OrderID as an dimension to work with it. Impossible or not? Well, I wouldn't have started this article, if there was no possibility ;-). Here are a number of steps required to get this work, but finally it will fly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;═►download "Endresult_Presentation_5min.swf" for a Flash-Video showing the final result of this thread in action&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;Prerequisite&lt;/SPAN&gt;: One prerequisite at this point is that the new OrderIDs must be able to be "guessed". This is the case, when the OrderID is a unique incremental number, so that you know, if the latest OrderID for now is 1024, the next one will be 1025 and so on. If the ID of a new Order cannot be "guessed", I am afraid, then this article cannot help (however, the unique ID could be a new ID column with an increment. It does not need to be the Order ID from the system itself ...)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my simple order table "SalesOrderTable" on a SQL Server. OrderID is an auto-incremental key column. The CreationDate is system-filled with the timestamp when the record was inserted. CustomerID, ProductID are foreign keys.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="53257" alt="Clipboard01.gif" class="jive-image" src="https://community.qlik.com/legacyfs/online/53257_Clipboard01.gif" /&gt;&lt;/P&gt;&lt;P&gt;Command to create this table on SQL Server is&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;CREATE TABLE SalesOrderTable&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderID bigint IDENTITY(1000,1) NOT NULL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CreationDate datetime NOT NULL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID int NOT NULL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductID int NOT NULL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderValue money NULL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt; CONSTRAINT PK_SalesOrderTable PRIMARY KEY CLUSTERED&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ( OrderID ASC ) ON [PRIMARY]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;ALTER TABLE SalesOrderTable&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;ADD CONSTRAINT DF_SalesOrderTable_CreationDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;DEFAULT (getdate()) FOR CreationDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; font-size: 12pt; text-decoration: underline;"&gt;&lt;STRONG&gt;Step 1: Get a text message about new orders and list all orders&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The approach seemed clear to me, since I just want to count the new orders, I will load all fields (even the OrderID) as MEASURE fields, but Direct Discovery requires &lt;SPAN style="text-decoration: underline;"&gt;at least one&lt;/SPAN&gt; DIMENSION field. I created a &lt;STRONG&gt;View "vw_SalesOrderTable"&lt;/STRONG&gt; to show all columns plus one calulated column called "AllRecords", which always shows 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;CREATE VIEW vw_SalesOrderTable AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;SELECT 1 AS AllRecords, * FROM SalesOrderTable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I load that view with DIRECT SELECT command and my only dimension is the AllRecords column. By setting a filter "1" on that field later in the GUI, I will automatically refer to every order in the view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data model has two separated tables, the memory orders and the DirectTable orders.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="53258" alt="Clipboard01.gif" class="jive-image jiveImage" src="https://community.qlik.com/legacyfs/online/53258_Clipboard01.gif" /&gt;&lt;/P&gt;&lt;P&gt;The script sets the Direct Discovery cache to expire every second with that line:&lt;/P&gt;&lt;P&gt;SET DirectCacheSeconds = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;═►download "&lt;SPAN style="text-decoration: underline;"&gt;DD Show New Orders-0.qvw&lt;/SPAN&gt;" for this status of the game&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are only two objects, which can deal with new orders like this: A textbox and a table-object. A chart-object would not!&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I created a table object, which contains the colum "AllRecords"&lt;/LI&gt;&lt;LI&gt;I created a button with the label "Refresh" which toggles the selection of value "1" in field "AllRecords" (=sets and removes 1 from that field)&lt;/LI&gt;&lt;LI&gt;I created a text object which displays a message as soon as (after clicking Refresh) new orders where found. Formula is&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;=If(Count(sql.OrderID) &amp;gt; Count(mem.OrderID), Count(sql.OrderID) - Count(mem.OrderID) &amp;amp; ' new order(s) found since last reload')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="53260" alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/53260_pastedImage_4.png" style="width: 620px; height: 245px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clearly, this was not good enough yet. I wanted to select with one click in a field the new orders or the orders found in memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; font-size: 12pt; text-decoration: underline;"&gt;&lt;STRONG&gt;Step 2: Get a dimension "IsLoadedInQV" as selection box &lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is like follows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;After loading all Orders into memory I will write back the creation timestamp of the "youngest" order (the one with the highest OrderID) into a separate SQL table "Last_QV_Load"&lt;/LI&gt;&lt;LI&gt;The SQL view, which is subject to the Direct Query, will get another calculated column, which will print "Mem" in case the record&amp;nbsp; creation timestamp is equal or lower than the saved timestamp from the table "Last_QV_Load", otherwise it will print "New". In fact, not QlikView can tell the "new" from the "mem" Orders, the view itself does!&lt;/LI&gt;&lt;LI&gt;During reload, I will already add the value "New" to a memory table in QV, although at that very moment, there is no "New" in the view yet. But there will be, as soon as more orders will be created after the reload (again: "guessing" a dimension value in advance)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this step I need two new objects in SQL: A new table "Last_QV_Load" and a stored procedure "sp_Set_QV_LoadTime":&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;CREATE TABLE Last_QV_Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TableName nvarchar(50) NOT NULL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last_Loaded_Record datetime NOT NULL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QV_Load_Time datetime NOT NULL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONSTRAINT PK_Last_QV_Load PRIMARY KEY CLUSTERED &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ( TableName ASC&amp;nbsp;&amp;nbsp;&amp;nbsp; ) ON [PRIMARY]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="53261" alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/53261_pastedImage_20.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;CREATE PROCEDURE sp_Set_QV_LoadTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @TableName NVARCHAR(50)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,@Cutofftime DATETIME = NULL &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;BEGIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DELETE FROM Last_QV_Load WHERE TableName = @TableName;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT INTO Last_QV_Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT @TableName, @Cutofftime, GetDate();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;END&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P&gt;I need to alter the view "vw_SalesOrderTable" as well and add the new column:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;CREATE VIEW vw_SalesOrderTable AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;SELECT&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 AS AllRecords&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,CASE WHEN o.CreationDate &amp;lt;= l.Last_Loaded_Record THEN 'Mem' ELSE 'New' END AS IsLoadedInQV&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,o.* &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="padding-left: 60px;"&gt;FROM &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SalesOrderTable AS o&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;LEFT OUTER JOIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last_QV_Load AS l&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON l.TableName = 'SalesOrderTable'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P&gt;The load script is creating a data model as follows. If you like to see the Load Script,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;═►download "&lt;SPAN style="text-decoration: underline;"&gt;DD Show New Orders-1.qvw&lt;/SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="53262" alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/53262_pastedImage_32.png" style="width: 620px; height: 143px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My frontend has now a new field "%IsLoadedInQV" with two values "Mem" and "New" which I can click to see the right Orders in the table object. But please note: You could not use a chart object to display orders here, because there is no dimensionality on the OrderID (this is a measure right now) ...!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="53264" alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/53264_pastedImage_38.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; font-size: 12pt; text-decoration: underline;"&gt;&lt;STRONG&gt;Step 3: Dynamically add new OrderIDs to a listbox and create a chart object&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; font-size: 12pt; text-decoration: underline;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The final steps are to link the two data islands via the common OrderID and to "guess" some future OrderIDs already in the script. As written above already, it is necessary to do that in the script at load-time. The ideal situation is an auto-incremental OrderID field, so you will easily know the number range of the next IDs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, Direct Discovery will be able to link the next new orders to the in-memory model as they come. BUT ... there will only one 'disturbance' in the scene: The QlikView native caching of in-memory queries. We turned off the SQL cache, yes, but the new OrderIDs (the ones arriving after the reload) are in memory, not on SQL. And the memory cache can NOT be set to expire! It can only be invalidated by creating new and new artificial selection combinations, so that QlikView never can use that cache (this is the job of table "InvalidateCache" in the below model). For the current Service Release (11.2 SR5), this is my "clean" workaround (not mentioning dirty ways of disabling the cache with specific internal settings)&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="53265" alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/53265_pastedImage_20.png" style="width: 620px; height: 316px;" /&gt;&lt;/P&gt;&lt;P&gt;The field InvalidateCacheToken contains for each user some hundred of "tokens". Each time, the user clicks on "Refresh" button in the frontend, the next token will be selected and QlikView will (re)start both, the in-memory and the SQL queries to find out about the new situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, I don't like to show the field "%OrderID" in a listbox in the frontend, because this will show not only existing OrderIDs but also the next 1000 (or so) "guessed" OrderIDs. I only want to see such %OrderIDs in my listbox which are at the very point in time already existing in the SQL table (before or since the reload). The formula for a selection box to do so is this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Aggr(Min(sql.OrderID), %OrderID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;download "&lt;SPAN style="text-decoration: underline;"&gt;DD Show New Orders-Final.qvw&lt;/SPAN&gt;" to see the load script and frontend&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;═►download "Endresult_Presentation_5min.swf" for a Flash-Video showing the final result of this article in action&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;IMG alt="" class="jiveImage" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Oh, almost forgot to mention, that the view "vw_SalesOrderTable" got&lt;SPAN style="text-decoration: underline;"&gt; one more column&lt;/SPAN&gt;, a copy of the OrderID called "OrderID_Dim". OrderID is loaded twice in the data model, as a MEASURE FIELD (as in previous steps) but also as a DIMENSION field in the DIRECT SELECT statement. Therefore, the view shows the OrderID twice, as "OrderID" and as "OrderID_Dim".&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;CREATE VIEW vw_SalesOrderTable AS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;SELECT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 AS AllRecords&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,CASE WHEN o.CreationDate &amp;lt;= l.Last_Loaded_Record THEN 'Mem' ELSE 'New' END AS IsLoadedInQV&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,o.* &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,o.OrderID AS OrderID_Dim&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;FROM &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SalesOrderTable AS o&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;LEFT OUTER JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt; color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last_QV_Load AS l&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON l.TableName = 'SalesOrderTable'&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 14:14:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591055#M437863</guid>
      <dc:creator>ChristofSchwarz</dc:creator>
      <dc:date>2014-02-15T14:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time analysis of new incoming transactions with DD</title>
      <link>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591056#M437864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the documentation.&lt;/P&gt;&lt;P&gt;Zeljko&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 13:34:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591056#M437864</guid>
      <dc:creator />
      <dc:date>2014-02-17T13:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time analysis of new incoming transactions with DD</title>
      <link>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591057#M437865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nice work!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I got some strange behaivor...&lt;/P&gt;&lt;P&gt;%IsLoadedInQV in the bottom right does not quite work.&lt;/P&gt;&lt;P&gt;First it show New after a total reload,&lt;/P&gt;&lt;P&gt;After the 4:th record I get "&amp;nbsp;&amp;nbsp; 666&amp;nbsp;&amp;nbsp; ###" as value&lt;/P&gt;&lt;P&gt;After a few more records I get Allocated Memory Exceeded &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but putting the %IsLoadedInQV inside a min() seems to do the trick...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It could of course be a SR6 Beta issue...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Hans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 22:41:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591057#M437865</guid>
      <dc:creator />
      <dc:date>2014-04-02T22:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time analysis of new incoming transactions with DD</title>
      <link>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591058#M437866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, now I also tested i&amp;nbsp; SR5 and it works fine there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some thing happend between SR5 and SR6 Beta...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Hans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 22:50:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591058#M437866</guid>
      <dc:creator />
      <dc:date>2014-04-02T22:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time analysis of new incoming transactions with DD</title>
      <link>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591059#M437867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for letting me know. I will have a look into this and report a bug.&lt;/P&gt;&lt;P&gt;SR6, however, replaces some workarounds of SR5 already. I will have to rewrite the article to match the SR6 behavior anyways ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 11:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591059#M437867</guid>
      <dc:creator>ChristofSchwarz</dc:creator>
      <dc:date>2014-04-04T11:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time analysis of new incoming transactions with DD</title>
      <link>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591060#M437868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please feel free to elaborate little about the workaround/replacements.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Hans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2014 07:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591060#M437868</guid>
      <dc:creator />
      <dc:date>2014-04-10T07:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Real-time analysis of new incoming transactions with DD</title>
      <link>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591061#M437869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow.. nice sharing, thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have questions:&lt;/P&gt;&lt;P&gt;Can the DD qvw display automatically refresh without user clicking?&lt;/P&gt;&lt;P&gt;so that we can built an online dashboard to display on big lcd screen.&lt;/P&gt;&lt;P&gt;Currently we already use qvd load with 'Enable Push from Server', and display using IE Plugin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moveover, can we combine historical qvd data with online DD load data to display in one qvw ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 10:20:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Real-time-analysis-of-new-incoming-transactions-with-DD/m-p/591061#M437869</guid>
      <dc:creator />
      <dc:date>2014-06-11T10:20:08Z</dc:date>
    </item>
  </channel>
</rss>

