<?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 Set Analysis - Has anyone got a tutorial/examples of this? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148423#M505227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anita,&lt;/P&gt;&lt;P&gt;Please try this link instead: &lt;A href="http://community.qlik.com/media/p/82595.aspx"&gt;http://community.qlik.com/media/p/82595.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Apr 2010 16:27:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-07T16:27:05Z</dc:date>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148413#M505217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Is there a tutorial or examples of set anaylsis flying around? I need to be able to use today's date to calculate the accounting period that we are in and then using that answer, calculate how much sales we have using the answer as a filter.&lt;/P&gt;&lt;P&gt;i.e Today is July 2nd, The accounting period that it is in is July (There is an accounting period table with dates and the date 02/07/2009 has the Period July). and I have to sum up the values in that period.&lt;/P&gt;&lt;P&gt;I have 2 tables&lt;/P&gt;&lt;P&gt;Acc Period&lt;/P&gt;&lt;P&gt;Date Period&lt;/P&gt;&lt;P&gt;26/06/2009 June&lt;/P&gt;&lt;P&gt;27/06/2009 June&lt;/P&gt;&lt;P&gt;28/06/2009 July&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;24/07/2009 July&lt;/P&gt;&lt;P&gt;25/07/2009 August&lt;/P&gt;&lt;P&gt;Sales&lt;/P&gt;&lt;P&gt;Date Value&lt;/P&gt;&lt;P&gt;27/06/2009 100&lt;/P&gt;&lt;P&gt;28/06/2009 200&lt;/P&gt;&lt;P&gt;24/07/2009 150&lt;/P&gt;&lt;P&gt;25/07/2009 100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the example there, I would expect my sum to equal 350.&lt;/P&gt;&lt;P&gt;Could you please help?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 01:42:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148413#M505217</guid>
      <dc:creator />
      <dc:date>2009-07-03T01:42:28Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148414#M505218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not really following your data there, so I'll just give a few good places to look.&lt;/P&gt;&lt;P&gt;1. Right here. On the right hand side of the forum, you should see Popular Tags. Set Analysis is the largest. Click on that and get a list of all forum posts tagged as Set Analysis. Searching for Set Analysis and Date should get you some good examples.&lt;/P&gt;&lt;P&gt;2. The Reference Guide. There is now a Set Analysis section at the end of Book II. That's how I learned the basics. I have it printed out and regularly refer to it when exact syntax slips my mind.&lt;/P&gt;&lt;P&gt;I'm assuming you already have some Set Analysis going, maybe you could post what you have so far.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 02:03:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148414#M505218</guid>
      <dc:creator />
      <dc:date>2009-07-03T02:03:19Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148415#M505219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Help section also has a nice article about Set Analysis with many helpful examples.&lt;/P&gt;&lt;P&gt;Looking at your requirement, though, I think you should start at the script level, not within the expression. When you reload the data, it's very common to capture the "Current Date" into a variable. It's also pretty common to calculate Current Fiscal Year and CUrrent Fiscal Month.&lt;/P&gt;&lt;P&gt;Many people stop there and then load their logic into their expressions - using either IF statements or Set Analysis. As a result, expressions become very hard to read.&lt;/P&gt;&lt;P&gt;I usually claculate a set of flags - for example, Current_Month_Flag, YTD_Flag, Rolling12_Flag, etc... Each flag gets a 1 when the condition is true or null() when it's false.&lt;/P&gt;&lt;P&gt;With the flags, you can construct your statement like this:&lt;/P&gt;&lt;P&gt;"Current Month Sales" = sum(Sales*Current_Month_Flag)&lt;/P&gt;&lt;P&gt;or, if you really want to use Set Analysis, the expression is still pretty simple:&lt;/P&gt;&lt;P&gt;"Current Month Sales" = sum( {$ &amp;lt;Current_Month_Flag = {1} &amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 03:12:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148415#M505219</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-07-03T03:12:20Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148416#M505220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wouldn't use sum(Sales*Current_Month_Flag). It might take the fewest characters to type, but it isn't particularly clear from a maintenance perspective, and isn't particularly fast from a performance perspective.&lt;/P&gt;&lt;P&gt;Marginally faster and (to me) much more clear is sum(if(Current_Month_Flag,Sales)).&lt;/P&gt;&lt;P&gt;The fastest but somewhat less clear (to me) approach is set analysis with the flag as mentioned, sum({&amp;lt;Current_Month_Flag={1}&amp;gt;}Sales). Since it is less clear, it may not be worth the headache if your data set isn't huge. But you may benefit from simply standardizing on the fastest approach, so that the same approach is used across all applications regardless of necessary performance in each.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 03:29:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148416#M505220</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-07-03T03:29:08Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148417#M505221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;Check out this file from the Share QlikViews section; might help out with some basic Set Analysis examples:&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/media/p/64362.aspx"&gt;http://community.qlik.com/media/p/64362.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 11:22:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148417#M505221</guid>
      <dc:creator />
      <dc:date>2009-07-03T11:22:00Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148418#M505222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;I can't quite agree with your reasoning... Clarity is a matter of personal taste (once you get used to using flags, it's pretty darn clear to me), but performance can be measured...&lt;/P&gt;&lt;P&gt;Prior to Set Analysis, multiplication produced much faster results than IF formulas. In one extreme case, I managed to reduce calculation time for a large pivot table from 88 sec. (!) to less than a second, just by replacing a number of IF formulas with pre-calculated flags.&lt;/P&gt;&lt;P&gt;Using Set Analysis "might" be even faster than multiplication, but I haven't had a chance yet to test it out on a large data set.&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Jul 2009 00:38:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148418#M505222</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-07-04T00:38:24Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148419#M505223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fully agree,&lt;/P&gt;&lt;P&gt;described way of multiplication with either 1 or 0 has been the fasted way in SQL and QV as well. Do consider the SET-Analysis more a way of individual calculation "on the fly", whereas assigning a flag in the script requires already a clear definition of the final product....&lt;/P&gt;&lt;P&gt;/Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 03:33:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148419#M505223</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2009-07-06T03:33:13Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148420#M505224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all your help. I will have a look through to see what is the best solution for me and post any updates on here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 19:10:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148420#M505224</guid>
      <dc:creator />
      <dc:date>2009-07-06T19:10:07Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148421#M505225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Oleg Troyansky wrote:Prior to Set Analysis, multiplication produced much faster results than IF formulas. In one extreme case, I managed to reduce calculation time for a large pivot table from 88 sec. (!) to less than a second, just by replacing a number of IF formulas with pre-calculated flags.&lt;BR /&gt;Using Set Analysis "might" be even faster than multiplication, but I haven't had a chance yet to test it out on a large data set.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Peter Rieper wrote:described way of multiplication with either 1 or 0 has been the fasted way in SQL and QV as well.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I've been trying to measure performance of the various approaches in this thread:&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/forums/p/17188/69900.aspx#69900"&gt;http://community.qlik.com/forums/p/17188/69900.aspx#69900&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I recently improved my testing method, and came to a more detailed conclusion about IF vs. multiplication. IF vs. multiplication performance appears to depend heavily on the situation. Here are my overall conclusions for version 8.50.6231.5:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Set analysis is MUCH faster than IF or multiplication.&lt;/LI&gt;&lt;LI&gt;Using a 1/Null flag is faster than a 1/0 flag or not using a flag.&lt;/LI&gt;&lt;LI&gt;IF is faster than multiplication when using flags.&lt;/LI&gt;&lt;LI&gt;Multiplication is MUCH faster than IF when NOT using flags.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;(Edit: Oleg, to expand on this a little, if you replaced a complicated IF expression with a multiplication by a 1/Null flag, a large performance improvement is to be expected. But I would expect you to see slightly better performance still by replacing the multiplication with an IF check of the same flag, and much better performance still by replacing the multiplication with a set analysis expression using the same flag. As best I can tell, it's the flag itself offering the performance improvement, not the multiplication. Unless you're saying you were using a flag already, in which case I can't account for our differing results, though using different versions might easily explain it.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 23:16:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148421#M505225</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-07-13T23:16:03Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148422#M505226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This link is no longer working. Any suggestion?&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/media/p/64362.aspx"&gt;http://community.qlik.com/media/p/64362.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 11:01:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148422#M505226</guid>
      <dc:creator>anitamelbye</dc:creator>
      <dc:date>2010-04-07T11:01:42Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - Has anyone got a tutorial/examples of this?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148423#M505227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anita,&lt;/P&gt;&lt;P&gt;Please try this link instead: &lt;A href="http://community.qlik.com/media/p/82595.aspx"&gt;http://community.qlik.com/media/p/82595.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 16:27:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Has-anyone-got-a-tutorial-examples-of-this/m-p/148423#M505227</guid>
      <dc:creator />
      <dc:date>2010-04-07T16:27:05Z</dc:date>
    </item>
  </channel>
</rss>

