<?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 Optimize UI Performance with Flags and Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642753#M235511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: tahoma, arial, helvetica, sans-serif;"&gt;In my prior work as a developer and in talking with my Qlik peers there is agreement that creating binary flags in the script (to assist in identifying key segments) is best practice.&amp;nbsp; Anytime you can pre-process data in the script, the UI will perform faster and have less work to do.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;Less widely understood is what to do in the UI once the flags have been created.&amp;nbsp; How should these flags be used in expressions?&amp;nbsp; Which approach yields the best performance?&amp;nbsp; One valid typical approach uses set analysis in the following manner to sum Sales where the flag is true:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon;"&gt;ScriptFlag&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt; = {1}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon;"&gt;SalesAmount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;However, this approach still requires the UI to conditionally evaluate a true/false comparison.&amp;nbsp; From a performance standpoint (important with big data) there is an alternate approach I recommend - &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: black; font-size: 9pt; text-decoration: underline;"&gt;&lt;STRONG&gt;special thanks to Kris Balow (&lt;SPAN style="color: black; font-size: 9pt; text-decoration: underline;"&gt;&lt;STRONG&gt;@KrisBalow)&lt;/STRONG&gt;&lt;/SPAN&gt; from Grange Insurance for suggesting this&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt; line-height: 1.5em;"&gt;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;When leveraging binary flags (0,1) from the script, simple multiplication of the (flag * metric) performs much faster in the application UI.&amp;nbsp; In my testing, both methods appear to return valid results.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;This concept may not work with all aggregate functions, but sum, avg, and count are compatible.&amp;nbsp; Just think about the math before you do it.&amp;nbsp; It’s faster than set analysis because there is no conditional evaluation involved.&amp;nbsp; It’s a simple straight calculation across all records.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;Recently I saw a &lt;SPAN style="text-decoration: underline;"&gt;70% improvement in response time&lt;/SPAN&gt; in a customer application by making this simple shift. Using set analysis the response time between clicks was 4-6 seconds. Using straight multiplication it dropped to 1-2 seconds.&amp;nbsp; In this case, a pretty big deal for the users who were making 500+ selections a day.&amp;nbsp; As always, performance lifts will depend on the application.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon;"&gt;ScriptFlag&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon;"&gt;SalesAmount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;) – &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;performs much faster&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;Questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;- What performance lift do you get?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;- What limitations do you see with this approach?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: black; font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif;"&gt;Kyle&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2014 14:42:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-06-06T14:42:11Z</dc:date>
    <item>
      <title>Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642753#M235511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: tahoma, arial, helvetica, sans-serif;"&gt;In my prior work as a developer and in talking with my Qlik peers there is agreement that creating binary flags in the script (to assist in identifying key segments) is best practice.&amp;nbsp; Anytime you can pre-process data in the script, the UI will perform faster and have less work to do.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;Less widely understood is what to do in the UI once the flags have been created.&amp;nbsp; How should these flags be used in expressions?&amp;nbsp; Which approach yields the best performance?&amp;nbsp; One valid typical approach uses set analysis in the following manner to sum Sales where the flag is true:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon;"&gt;ScriptFlag&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt; = {1}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon;"&gt;SalesAmount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;However, this approach still requires the UI to conditionally evaluate a true/false comparison.&amp;nbsp; From a performance standpoint (important with big data) there is an alternate approach I recommend - &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: black; font-size: 9pt; text-decoration: underline;"&gt;&lt;STRONG&gt;special thanks to Kris Balow (&lt;SPAN style="color: black; font-size: 9pt; text-decoration: underline;"&gt;&lt;STRONG&gt;@KrisBalow)&lt;/STRONG&gt;&lt;/SPAN&gt; from Grange Insurance for suggesting this&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt; line-height: 1.5em;"&gt;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;When leveraging binary flags (0,1) from the script, simple multiplication of the (flag * metric) performs much faster in the application UI.&amp;nbsp; In my testing, both methods appear to return valid results.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;This concept may not work with all aggregate functions, but sum, avg, and count are compatible.&amp;nbsp; Just think about the math before you do it.&amp;nbsp; It’s faster than set analysis because there is no conditional evaluation involved.&amp;nbsp; It’s a simple straight calculation across all records.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif; color: black;"&gt;Recently I saw a &lt;SPAN style="text-decoration: underline;"&gt;70% improvement in response time&lt;/SPAN&gt; in a customer application by making this simple shift. Using set analysis the response time between clicks was 4-6 seconds. Using straight multiplication it dropped to 1-2 seconds.&amp;nbsp; In this case, a pretty big deal for the users who were making 500+ selections a day.&amp;nbsp; As always, performance lifts will depend on the application.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon;"&gt;ScriptFlag&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon;"&gt;SalesAmount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black;"&gt;) – &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;performs much faster&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;Questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;- What performance lift do you get?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;- What limitations do you see with this approach?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: tahoma, arial, helvetica, sans-serif; font-size: 9pt; line-height: 1.5em;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: black; font-size: 9pt; font-family: tahoma, arial, helvetica, sans-serif;"&gt;Kyle&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 14:42:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642753#M235511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-06T14:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642754#M235512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kyle,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a great "Pub question". It's been argued over many beers for many years. On the question of multiplication vs set analysis, I would say that one does not always perform better than the other. There was a great thread here in the long gone wiki (referenced in this thread &lt;A href="https://community.qlik.com/message/1987"&gt;Performance: Set Analysis vs. IF vs. Multiplication&lt;/A&gt;)&amp;nbsp; where case studies proved both points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/2310"&gt;Oleg Troyansky&lt;/A&gt;, who is my performance goto person, has done studies that choose Set Analysis as the fastest approach. Although I know I've been able to create an example where multiplication is faster, I haven't been able to produce a current example for him.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your post you say that Set Analysis requires a conditional true/false evaluation. Set Analysis uses the selection engine and does not make conditional row by row tests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: I just reran John's benchmark from the thread, and Multiplication performed much better than Set Analysis. This is contrary to the results he published in 2009. Then I moved the flag field from the fact table to a separate table -- which would be a common if using a master calendar -- and Set Analysis outperformed Multiplication. That makes sense as the multiplication is no longer a single row operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kyle, in the case you cited above, is your flag on the fact table? ie same table as SalesAmount?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 15:59:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642754#M235512</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-06-06T15:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642755#M235513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is very insightful. In both cases (multiplication and set analysis) are flags being used?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 16:36:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642755#M235513</guid>
      <dc:creator />
      <dc:date>2014-06-06T16:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642756#M235514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jacob - yes, in both cases flags are being used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2014 11:37:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642756#M235514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-09T11:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642757#M235515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob - you make a great point:&amp;nbsp; "&lt;EM&gt;One does not always outperform the other&lt;/EM&gt;".&amp;nbsp; While I've not yet encountered that, your recent test highlights this.&amp;nbsp; This is understandable given how UI layout, expression syntax and data model design all contribute to overall performance.&amp;nbsp;&amp;nbsp; As outlined &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/01/28/memory-statistics"&gt;here&lt;/A&gt; Qlik provides testing tools such as the Memory Statistics file or QlikOptimizer.qvw to see what is the best approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Example I cited, where multiplication outperformed:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- data model design was multiple fact tables joined through a link table&lt;/P&gt;&lt;P&gt;- master calendar joined to link table (flags here)&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- 15 expressions updating with each click:&amp;nbsp; (i.e. uses multiple time period flags paired and multiple facts)&lt;/P&gt;&lt;P&gt;- Variables used in expressions allowing users to select which time period flag is used in the expression.&lt;/P&gt;&lt;P&gt;- Volume:&amp;nbsp; ~10 million records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kyle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2014 12:40:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642757#M235515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-09T12:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642758#M235516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/2286"&gt;Rob Wunderlich&lt;/A&gt; pointed me to this thread as I was also running some tests on this subject. My findings were that overall multiplication seem to outperform (or perform at least as well as) SA in nearly every scenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Metrics in fact table (25 million records), flags in small dimension table (50k records): multiplication around 10% - 20% faster&lt;/LI&gt;&lt;LI&gt;Metric in fact table (25 million records), flags in large dimension table (10 million records): SA 25% - 50% faster&lt;/LI&gt;&lt;LI&gt;Metrics and flags both in a single fact table (25 million records): multiplication around 60% faster&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While in the large dimension table SA outperforms multiplication considerably, this is probably not a scenario that you encounter every day. Overall, my tests seem to indicate that multiplication is a better 'default' option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's interesting to note (and this makes sense) is that multiplication has nearly identical performance irrespective of the number of matching flags (as it process all flags in the current selection state, whether they match or not). I did tests with flags matching on 5%, 25%, 50% and 80% of the records and multiplication performed consistently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Set Analysis, a higher number of matches led to lower performance. Between 5 and 80% matches there was a 12% decrease in performance for the fact table/small dimension table scenario, and even a 35% decrease in performance for the fact table/large dimension table (but still faster than multiplication).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My full results are shown below. QlikView caching was disabled and for each test QlikView was closed and reopened. The "initial" column shows the calculation time right after opening the document, the "bookmark" column shows the calculation time after selecting a bookmark with a single filter value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that multiplication does seem to perform worse when first opening the file, but that looks like a minor drawback to me, as it only happens once, whereas selections are made constantly. Also note that my test methodology might be flawed/skewed in some way, I tried to control for every variable but might've overlooked something (and if you see anything, do not hesitate to point it out). I will probably retest this on an actual client application to see if real-world result match my "lab" results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="60659" alt="SAvsMultiply.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/60659_SAvsMultiply.png" /&gt;&lt;/P&gt;&lt;P&gt;/CC &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;Henric Cronström&lt;/A&gt;, based on general recommendations, I was expecting SA to outperform multiplication. Perhaps you can shed some light on how QlikView handles these things "under the hood"? Or, has there been some additional optimization in newer version of QV? (like with Count(DISTINCT))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 16:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642758#M235516</guid>
      <dc:creator>barryharmsen</dc:creator>
      <dc:date>2014-06-16T16:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642759#M235517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect that the main difference is &lt;STRONG&gt;&lt;EM style="text-decoration: underline;"&gt;where&lt;/EM&gt;&lt;/STRONG&gt; the flag is - in the fact table or in the dimension table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further, there are four ways to use a flag:&lt;/P&gt;&lt;P&gt;- Sum(If(Flag='True', Amount))&amp;nbsp;&amp;nbsp; // String comparison&lt;/P&gt;&lt;P&gt;- Sum(If(Flag, Amount))&amp;nbsp;&amp;nbsp; // Boolean condition&lt;/P&gt;&lt;P&gt;- Sum(Flag * Amount)&amp;nbsp;&amp;nbsp; // Multiplication &lt;/P&gt;&lt;P&gt;- Sum({$&amp;lt;Flag={1}&amp;gt;} Amount)&amp;nbsp;&amp;nbsp; // Set Analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that the string comparison is the really expensive one, and the others are (roughly) comparable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will look into it and come back. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 21:30:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642759#M235517</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2014-06-16T21:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642760#M235518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Barry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;really interesting findings so far. What also should be considered in a comparison is the workload on the cores and the probabily of cache reuse. If the overall workload is lower on one approach it would help in a multiuser environment to keep free ressources for other tasks and I would prefer it even with an additional processing time.&lt;/P&gt;&lt;P&gt;Also, I would guess that the cache reuse probability of set analysis is higher since very often the same "filter" is used in different expressions and it could just grab the same set of data. But this should be measured out somehow or someone from the labs could know..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 23:02:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642760#M235518</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-16T23:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642761#M235519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Provocative comment Ralf.&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; I would guess that the cache reuse probability of set analysis is higher since very often the same "filter" is used in different expressions and it could just grab the same set of data.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My read of &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;Henric Cronström&lt;/A&gt; post &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2014/04/14/the-qlikview-cache" title="http://community.qlik.com/blogs/qlikviewdesignblog/2014/04/14/the-qlikview-cache"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2014/04/14/the-qlikview-cache&lt;/A&gt; was that cache stores the &lt;EM&gt;results&lt;/EM&gt; of data + expression. If the data set is itself a separate cache element that would radically change my understanding of the cache.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 04:30:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642761#M235519</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-06-17T04:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642762#M235520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ralf is right. A Set Analysis calculation is a two-step process:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Set is calculated (like a selection) and cached, and&lt;/LI&gt;&lt;LI&gt;The chart aggregation is calculated and cached&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Hence, if the same Set is used in several charts, it will indeed make use of the cache efficiently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 08:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642762#M235520</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2014-06-20T08:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642763#M235521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have just like you also made some test and compared the different cases. I will write a blog post about the results, but I can already now say the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is some overhead with Set Analysis that multiplication doesn't have, and as a consequence multiplication outperforms Set Analysis in small data sets (~1M rec). But if the data set becomes larger, Set Analysis outperforms multiplication.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence, in the cases where you need performance, Set Analysis is the best choice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 09:01:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642763#M235521</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2014-06-20T09:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642764#M235522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Henric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for clarification. The next question to me would be if this two-step process caching is made after parsing the expression. Because the set expression has to be parsed out of the whole expression. Hence, different spellings of the set analysis expression would have an effect or not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 09:15:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642764#M235522</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-20T09:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642765#M235523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great article!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jun 2014 14:55:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642765#M235523</guid>
      <dc:creator />
      <dc:date>2014-06-21T14:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642766#M235524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quite interesting... If it's done before parsing, it would make much sense to create sets in variables so they're always spelled the same (using parameters&amp;nbsp; would help in reusing these sets in different situations).&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>Mon, 23 Jun 2014 21:44:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642766#M235524</guid>
      <dc:creator>ablaas</dc:creator>
      <dc:date>2014-06-23T21:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize UI Performance with Flags and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642767#M235525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about if we use flags defined as duals?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load dual(text,value) as dualFlag inline &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;text,value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Yes,1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;No,0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I had to use the string comparison in the set analysis, so I had the worst scenario, as the syntax comparing the NUM value didn't work:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;dualFlag = { 1 } &amp;gt;} amount ); // didn't work&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;sum({$&amp;lt;dualFlag = { 'Yes' } &amp;gt;} amount ); // bad performance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum(dualFlag * amount); // is this the only choice?&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>Mon, 23 Jun 2014 22:01:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-UI-Performance-with-Flags-and-Set-Analysis/m-p/642767#M235525</guid>
      <dc:creator>ablaas</dc:creator>
      <dc:date>2014-06-23T22:01:43Z</dc:date>
    </item>
  </channel>
</rss>

