<?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 Best Practice Returning Large Datasets in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Best-Practice-Returning-Large-Datasets/m-p/387101#M485081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;My company offers QlikView reports through an iframe in a web app running in SAAS.&amp;nbsp; The QlikView QVW is housed on a QlikView Server, then picked up by a QlikView Publisher, translated to html then ported to the site.&amp;nbsp; Recently I got a assignment from the owner of my company to make our standard reports include what we call UDFs (User-Defined Fields) so that each client (which resides in a different db) can have any or all of their UDFs included in a existing report without it being different from client to client or db to db. Also each client has a variable number of UDFs as they are unlimited, and the UDFID is not a stable field; rather it changes with each deployment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;The query I am using now has mitigated much of the difficulties (below).&amp;nbsp; However, the query is still slow (return is approx 1:30 for only 8 udfs; more than 20 takes 45:00+).&amp;nbsp; I attribute much of the slowness to the amount of data needed to be returned.&amp;nbsp; In this case, the rows returned number over 6 million rows.&amp;nbsp; The reason for the large return is that the client has approximately 325,000 customers with each having a variable amount of UDFs out of the 57 total UDFs possible.&amp;nbsp; The report should be able to return any or all of the UDFs for each client in each report as they want the reports to appear to be ad-hoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;My DBA has asked if a Data Warehouse would be beneficial and to diagram what the architecture would look like.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Would a Data Warehouse be beneficial? &lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;How would getting records from two sources then linking them in a significant way to a single customer work in QlikView?&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Is there a better way to accomplish what the project requires?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Tables Involved,&amp;nbsp; Examples, and Query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;/////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;The tables involved are:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;CustomerValues-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID*, CustomerID, UDFValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Definitions-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID*, UDFName, FieldType&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;(* not stable, changes with each deployment)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;/////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Examples:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Client A (db A)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;CustomerValues-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID, CustomerID, UDFValue&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;11,111222,Mazda&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Definitions-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID,UDF Name, FieldType&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;11,Cars,String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Client B (db B)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;CustomerValues-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID, CustomerID, UDFValue&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;717,4325,3.14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Definitions-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID,UDF Name, FieldType&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;717,PiValue,Decimal(14,2)&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;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Query/Load Statement:&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;/////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13690618393298786" jivemacro_uid="_13690618393298786"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;//SQLDefinitions is a dummy table to represent the definition table in the sql database&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQLDefinitions:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQL SELECT TOP 3 * FROM UDFDefinitions ORDER BY UDFName;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;//add a record number so we can map the definations to the field names&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFDefinitions:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Load *, RecNo() as UDFFieldID Resident SQLDefinitions;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;//SQLValues is a dummy table to represent the data in the sql database&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQLValues:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQL SELECT * FROM UDFCustomerValues;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;LET vRowCount = NoOfRows('UDFDefinitions');&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;FOR counter = 1 to vRowCount&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vUDFID = Peek('UDFDefinitionID', counter -1, 'UDFDefinitions');&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vUDFieldId = Peek('UDFFieldID', counter -1, 'UDFDefinitions');&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vUDFieldName$(vUDFieldId) = Peek('UDFName', counter -1, 'UDFDefinitions');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UDFValues$(vUDFieldId):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load CustomerID, UDFValue as UDFField$(vUDFieldId) resident SQLValues where UDFDefinitionID = $(vUDFID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;drop Tables SQLValues, SQLDefinitions;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 May 2013 14:55:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-05-20T14:55:12Z</dc:date>
    <item>
      <title>Best Practice Returning Large Datasets</title>
      <link>https://community.qlik.com/t5/QlikView/Best-Practice-Returning-Large-Datasets/m-p/387101#M485081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;My company offers QlikView reports through an iframe in a web app running in SAAS.&amp;nbsp; The QlikView QVW is housed on a QlikView Server, then picked up by a QlikView Publisher, translated to html then ported to the site.&amp;nbsp; Recently I got a assignment from the owner of my company to make our standard reports include what we call UDFs (User-Defined Fields) so that each client (which resides in a different db) can have any or all of their UDFs included in a existing report without it being different from client to client or db to db. Also each client has a variable number of UDFs as they are unlimited, and the UDFID is not a stable field; rather it changes with each deployment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;The query I am using now has mitigated much of the difficulties (below).&amp;nbsp; However, the query is still slow (return is approx 1:30 for only 8 udfs; more than 20 takes 45:00+).&amp;nbsp; I attribute much of the slowness to the amount of data needed to be returned.&amp;nbsp; In this case, the rows returned number over 6 million rows.&amp;nbsp; The reason for the large return is that the client has approximately 325,000 customers with each having a variable amount of UDFs out of the 57 total UDFs possible.&amp;nbsp; The report should be able to return any or all of the UDFs for each client in each report as they want the reports to appear to be ad-hoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;My DBA has asked if a Data Warehouse would be beneficial and to diagram what the architecture would look like.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Would a Data Warehouse be beneficial? &lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;How would getting records from two sources then linking them in a significant way to a single customer work in QlikView?&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Is there a better way to accomplish what the project requires?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Tables Involved,&amp;nbsp; Examples, and Query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;/////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;The tables involved are:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;CustomerValues-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID*, CustomerID, UDFValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Definitions-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID*, UDFName, FieldType&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;(* not stable, changes with each deployment)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;/////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Examples:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Client A (db A)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;CustomerValues-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID, CustomerID, UDFValue&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;11,111222,Mazda&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Definitions-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID,UDF Name, FieldType&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;11,Cars,String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Client B (db B)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;CustomerValues-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID, CustomerID, UDFValue&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;717,4325,3.14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Definitions-&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFID,UDF Name, FieldType&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;717,PiValue,Decimal(14,2)&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;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Query/Load Statement:&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;/////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13690618393298786" jivemacro_uid="_13690618393298786"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;//SQLDefinitions is a dummy table to represent the definition table in the sql database&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQLDefinitions:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQL SELECT TOP 3 * FROM UDFDefinitions ORDER BY UDFName;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;//add a record number so we can map the definations to the field names&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;UDFDefinitions:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Load *, RecNo() as UDFFieldID Resident SQLDefinitions;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;//SQLValues is a dummy table to represent the data in the sql database&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQLValues:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQL SELECT * FROM UDFCustomerValues;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;LET vRowCount = NoOfRows('UDFDefinitions');&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;FOR counter = 1 to vRowCount&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vUDFID = Peek('UDFDefinitionID', counter -1, 'UDFDefinitions');&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vUDFieldId = Peek('UDFFieldID', counter -1, 'UDFDefinitions');&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vUDFieldName$(vUDFieldId) = Peek('UDFName', counter -1, 'UDFDefinitions');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UDFValues$(vUDFieldId):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load CustomerID, UDFValue as UDFField$(vUDFieldId) resident SQLValues where UDFDefinitionID = $(vUDFID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;drop Tables SQLValues, SQLDefinitions;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2013 14:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-Practice-Returning-Large-Datasets/m-p/387101#M485081</guid>
      <dc:creator />
      <dc:date>2013-05-20T14:55:12Z</dc:date>
    </item>
  </channel>
</rss>

