<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361933#M494026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, to see, how to use aggr refer to help, there it is explained with the examples also. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Apr 2012 17:46:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-21T17:46:58Z</dc:date>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361924#M494017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the difference between the following expressions::::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; Sum({$&amp;lt;Year = { "= $(vMaxYear) "&amp;nbsp;&amp;nbsp; } &amp;gt;&amp;nbsp; }&amp;nbsp; Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; Sum( {$&amp;lt;Year = {$(=vMaxYear) }&amp;nbsp; &amp;gt;}&amp;nbsp;&amp;nbsp; Sales)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vMaxYear = Max(Year)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 14:16:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361924#M494017</guid>
      <dc:creator />
      <dc:date>2012-04-20T14:16:24Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361925#M494018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year={"$(vMaxYear)"}&amp;gt;}&amp;nbsp; Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum( {$&amp;lt;Year={$(=vMaxYear)}&amp;gt;}&amp;nbsp;&amp;nbsp; Sales)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should behave the same. &lt;/P&gt;&lt;P&gt;in the first formula you don't need the equal sign and you must &lt;STRONG&gt;not &lt;/STRONG&gt;have additional spaces within the quotes (see John Whiterspoon's posts about the dual type) or the comparison will fail : 2012 equals "2012" for qlikview, but the string "2012 "&amp;nbsp; (additionnal space) will not match&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you add the heading equal sign as in your example above&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year={"=$(vMaxYear)"}&amp;gt;}&amp;nbsp; Sales), le formula max(Year) will be evaluated for each and every row in your current selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hilaire&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 16:27:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361925#M494018</guid>
      <dc:creator />
      <dc:date>2012-04-20T16:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361926#M494019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a follow-up to my comment above, &lt;/P&gt;&lt;P&gt;you'll find attached a sample qlikview app to help you figure out the differences between several syntaxes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using single and multiple selections on the year dimension, you'll see the behaviour for each syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the last "simple table" graph, there's a formula that shows the differences between the "early evaluation" (no equal sign) and the "late evaluation" (using equal sign) of your vMaxYear variable / formula&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hilaire&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 16:49:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361926#M494019</guid>
      <dc:creator />
      <dc:date>2012-04-20T16:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361927#M494020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I would appreciate if &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/hilaire_qv" id="jive-2407923372064631430855"&gt;Hilaire_qv&lt;/A&gt; as well other users can verify it, as it is my observation only and I could be wrong also)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per my understanding, These two are entirely different set analysis.&lt;/P&gt;&lt;P&gt;Expression no. 1 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;Year = { "= $(vMaxYear) "&amp;nbsp;&amp;nbsp; } &amp;gt;&amp;nbsp; }&amp;nbsp; Sales)&lt;/P&gt;&lt;P&gt;is a advanced set analysis expression and becomes a conditional expression. So, this set analysis will select Year values whenever this expression returns true. (it will evaluate this expression for all values in your field)&lt;/P&gt;&lt;P&gt;In qlikview front end only 0 is taken as false while all other values are taken as true. &lt;/P&gt;&lt;P&gt;(say your max year is 2012) So, basically what happens is that after $ sign expansion it will become {" = 2012 "} or in other worlds it will become &lt;STRONG&gt;{true()}&lt;/STRONG&gt; . and since it is always true then all the possible values in your year field will be selected (except null).&lt;/P&gt;&lt;P&gt;for example just search &lt;STRONG&gt;= 500 &lt;/STRONG&gt;in your list box and it will select all your values but if you search &lt;STRONG&gt;= 0&lt;/STRONG&gt; no value will be selected even if you &lt;STRONG&gt;have a value as 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression no. 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum( {$&amp;lt;Year = {$(=vMaxYear) }&amp;nbsp; &amp;gt;}&amp;nbsp;&amp;nbsp; Sales)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;is a basic set analysis expression which is not an evaluation expression and will simply search the values passed in curly braces.&lt;/P&gt;&lt;P&gt;when $ sign expansion is done it will become {2012} , so it will search for the 2012 in the year field and will sum all the sales values which are associated to 2012 as year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Point to note here is that &lt;/P&gt;&lt;P&gt;1st expression in conditional while second is search.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if you want your first expression to return same result as the second then change it to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;Year = { "= year = $(vMaxYear) "&amp;nbsp;&amp;nbsp; } &amp;gt;&amp;nbsp; }&amp;nbsp; Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which will give you same results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 17:00:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361927#M494020</guid>
      <dc:creator />
      <dc:date>2012-04-20T17:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361928#M494021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, attached is a sample app for your these 2 set expressions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 17:04:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361928#M494021</guid>
      <dc:creator />
      <dc:date>2012-04-20T17:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361929#M494022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashutosh &lt;/P&gt;&lt;P&gt;Thanks for the explanation ... it really helped me a lot .... can you plz explain that &lt;/P&gt;&lt;P&gt;when i am selecting more than one year then why the expression Sum({$&amp;lt;Year = {"=$(vMaxYear)"}&amp;gt; } Sales) is giving me sum of Sales for all the years i have selected and&amp;nbsp;&amp;nbsp; secondly why the below expression do not work......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Year = {"=$(vMaxYear)-1" }&amp;gt;}Sales) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2012 08:43:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361929#M494022</guid>
      <dc:creator />
      <dc:date>2012-04-21T08:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361930#M494023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First of all both of them are going to be conditional expression for set analysis which comes under advanced set analysis and here you are not passing values to be searched in Year field rahter you are passing an expression and set analysis expects that you want results when this passed expression results true.&lt;/P&gt;&lt;P&gt;as, I sain in Qlikview front end only 0 is false all other values are considered true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am selecting more than one year then why the expression Sum({$&amp;lt;Year = {"=$(vMaxYear)"}&amp;gt; } Sales) is giving me sum of Sales for all the years i have selected&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This will always give you sum of all the possible values, so if you select 2 years it will give you sum of 2 years data and if you don't select any year then it will give you sum of all the possible values for all years (instead of max year's values sum)&lt;/P&gt;&lt;P&gt;as it is always giving you some value which is not 0. if you want it to return you max year's values then use Sum({$&amp;lt;Year = {"= Year=$(vMaxYear)"}&amp;gt; } Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;secondly why the below expression do not work......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Year = {"=$(vMaxYear)-1" }&amp;gt;}Sales) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This expression should work, it will also give you the same result as the first expression. what are you getting in this expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, these results while using variables can vary depending on if you have used = in variable expression or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached file.&lt;/P&gt;&lt;P&gt;Hope this should answer your question, if not then let me know!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2012 09:48:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361930#M494023</guid>
      <dc:creator />
      <dc:date>2012-04-21T09:48:44Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361931#M494024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks bro...&amp;nbsp; can you plz help me wth aggr function also .... why and when we use it????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2012 14:57:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361931#M494024</guid>
      <dc:creator />
      <dc:date>2012-04-21T14:57:12Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361932#M494025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;aggr function is a function which is used when we need advanced aggregation.&lt;/P&gt;&lt;P&gt;Normally, aggregation functions such as sum will result in the sum of all the possible values. So, if we use it in a chart then it will give aggregation bifurcated (sum in case we use sum function) on the basis of chart's dimensions&lt;/P&gt;&lt;P&gt;and as well as based on the selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, there could be scenarios when we don't want to display aggregations directly.&lt;/P&gt;&lt;P&gt; For example one scenario could be that you want to display the largest sales amount done on the basis of states.&lt;/P&gt;&lt;P&gt;but you have data available based on the cities.&lt;/P&gt;&lt;P&gt;So, if you put &lt;STRONG&gt;max(sales)&lt;/STRONG&gt;, it will not work because it will give you highest sales value according to city.&lt;/P&gt;&lt;P&gt;but if you put it like&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;max(aggr(sum(sales),states)) &lt;/STRONG&gt;then it will aggregate the values according to states and then will give you max amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the same scenario can be thought of that in a chart you are not going to display states as dimension but you will use city, one column needs amount to be shown as city wise but there is one more column in which amount is needed to shown for state in which that city is?&lt;/P&gt;&lt;P&gt;then again, aggr function will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, points to note here are;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr function can do aggregations based on the field values passed which is not possible without aggr.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; you can not use one aggregation function on another aggregation function, so if you write &lt;STRONG&gt;max(sum(sales)) &lt;/STRONG&gt;this is not a vaild syntax in qlikview., in these scenarios aggr can be handy because with aggr you can do this also as I did in the &lt;STRONG&gt;max(aggr(sum(sales),states)) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2012 17:45:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361932#M494025</guid>
      <dc:creator />
      <dc:date>2012-04-21T17:45:12Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361933#M494026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, to see, how to use aggr refer to help, there it is explained with the examples also. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2012 17:46:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/361933#M494026</guid>
      <dc:creator />
      <dc:date>2012-04-21T17:46:58Z</dc:date>
    </item>
  </channel>
</rss>

