<?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: Set analysis: ColA &amp;lt;= ColB in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256293#M96985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although the conditional fixes the problem, it seems slower than set analysis. I have a lot of expressions and when I use set analysis it is evaluated really fast. But when I use the conditionals it is pretty slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It really surprised me that QlikView shows the behaviour I explained. And for me it is not logical. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would really like to understand why this happens. This way I might be able to find a way to work around it. Can you explain why QlikView behaves this way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jun 2011 06:43:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-06T06:43:21Z</dc:date>
    <item>
      <title>Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256287#M96979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to include everything in my set where Column_A has a value between 5 and 12, and where the value in Column_A is smaller or equal to the value in Column_B. In pseudo code it would look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;(Column_A &amp;gt;= 5 AND Column_A &amp;lt;=12)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AND&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;(Column_A &amp;lt;= Column_B)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this in set analysis? I have tried the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{1&amp;lt;Column_A = {"&amp;gt;=5&amp;lt;=12"}, Column_A = {"&amp;lt;=$(=[Column_B])"}&amp;gt;} [MyMeasure]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not work. I do not know how to select the &lt;SPAN style="font-family: courier new,courier;"&gt;(Column_A &amp;lt;= Column_B)&lt;/SPAN&gt; part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible using set analysis?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 08:54:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256287#M96979</guid>
      <dc:creator />
      <dc:date>2011-06-01T08:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256288#M96980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression should look like the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sum({&amp;lt; Column_A = {"&amp;gt;=5&amp;lt;=12"}, Column_A = {"=Column_A &amp;lt;= Column_B"} &amp;gt;} [MyMeasure])&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 09:06:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256288#M96980</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-01T09:06:16Z</dc:date>
    </item>
    <item>
      <title>Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256289#M96981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Try This:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;ColumnA = {'&amp;gt;=5&amp;lt;=12'}&amp;gt;}if(ColumnA&amp;lt;=ColumnB,Value)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 09:12:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256289#M96981</guid>
      <dc:creator />
      <dc:date>2011-06-01T09:12:32Z</dc:date>
    </item>
    <item>
      <title>Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256290#M96982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Miguel, that works excellent!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 10:43:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256290#M96982</guid>
      <dc:creator />
      <dc:date>2011-06-01T10:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256291#M96983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the example Miguel gave me I created the following simplified comparisson expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;SUM&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;[ColA] = {"=[ColA] &amp;lt;= [ColB]"}&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [Counter]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This really does an excellent job, but fails in a specific case. It took me a while to narrow it down, but the following example explains my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a simple inline table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;MyTest:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key, ColA, ColB, Counter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, AA, BB, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, CC, DD, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, EE, EE, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, FF, GG, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, EE, BB, 1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From this table I created the following table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="MyTest.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/4987_MyTest.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimensions are Key, ColA and ColB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All and Compare are both expressions. Where All contains&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;SUM(Counter)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and Compare contains the set analysis expression comparisson mentioned&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;SUM&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;[ColA] = {"=[ColA] &amp;lt;= [ColB]"}&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [Counter]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the column Compare should appear a 1 whenever ColA is smaller or equal to ColB. This is the case for the rows with Key 1, 2, 3 and 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the table displayed above the row with Key 3 does not display a 1 in the Compare column. But here comes the strange part. When I select the row with Key 3 it does display a 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="MyTest3.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/4994_MyTest3.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems to happen because the value EE appears twice in ColA:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="MyTestEE.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/4995_MyTestEE.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I isolate the value, and make sure that it does not occur more than once in the selection, it no longer shows the wrong value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="MyTest1234.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/4996_MyTest1234.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way I can make the Compare expression always show the correct value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 14:17:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256291#M96983</guid>
      <dc:creator />
      <dc:date>2011-06-03T14:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256292#M96984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case (row to row comparison, set analysis is used once and for the whole chart), I'd use a conditional instead of the set analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sum(If(ColA &amp;lt;= ColB, Counter))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 15:17:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256292#M96984</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-03T15:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256293#M96985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although the conditional fixes the problem, it seems slower than set analysis. I have a lot of expressions and when I use set analysis it is evaluated really fast. But when I use the conditionals it is pretty slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It really surprised me that QlikView shows the behaviour I explained. And for me it is not logical. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would really like to understand why this happens. This way I might be able to find a way to work around it. Can you explain why QlikView behaves this way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 06:43:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256293#M96985</guid>
      <dc:creator />
      <dc:date>2011-06-06T06:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256294#M96986</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;Set analysis is calculated once for the whole chart, and not value by value. That means that in &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sum({&amp;lt; ColA = {"=ColA &amp;lt;= ColB"} &amp;gt;} Counter)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ColA and ColB are evaluated for the whole chart, and thus is returned that value "EE" (one value) is not lower than or equal to "EE" and "BB" (two values). My guess is what is happening on the background is that QlikView asks "which value should be compared to which?" because there is no 1:1 relation, and returns false. If you use here any aggregation function such as MaxString or Min this will not work as well, because it will get the MaxString or the Min for the whole chart, and not for the current line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The conditional, although performing poorer, does match "line by line", or value by value, and thus returns the correct results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hops that makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 08:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256294#M96986</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-06T08:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256295#M96987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so we are assuming that QlikView automatically returns false, because it does not know which of the two values to compare it to?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried a workaround that would eliminate the doubles:&lt;/P&gt;&lt;P&gt;First I added and extra column to my inline table (Identifier)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;MyTest:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key, ColA, ColB, Counter, Identifier&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, AA, BB, 1, 1AA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, CC, DD, 1, 2CC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, EE, EE, 1, 3EE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, FF, GG, 1, 4FF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, EE, BB, 1, 5EE&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Identifier column is a concatenation of Key and ColA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I altered the set analysis expression as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sum({&amp;lt; Identifier = {"=Identifier &amp;lt;= $(=Key &amp;amp; ColB)"} &amp;gt;} Counter)&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really hoped that this would fool QlikView into making the right match. But it has no success. What do you think?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 08:37:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256295#M96987</guid>
      <dc:creator />
      <dc:date>2011-06-06T08:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256296#M96988</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;Again, you are asking to evaluate a Key and a ColB for which several values exist (keys 3 and 5 and ColB "EE" and "BB"). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;$(=Key &amp;amp; ColB)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is not evaluable, so the issue persists. For what it's worth, try the sames expression in a text object: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;=Key &amp;amp; ColB&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select "EE" in ColA. It will display "-" (null) because there are two possible different values for one of the two fields in the expression. Now select "AA" in ColA, "1BB" will be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Said in different words, with 5 rows of your data (so two "EE" values in ColA) using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sum(If(ColA PRECEDES ColB OR ColA = ColB, Counter))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will return different than&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;SUM({&amp;lt; [ColA] = {"=[ColA] PRECEDES [ColB]", "=[ColA] = [ColB]"}&amp;gt;} [Counter])&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first expression, it will return 1 for "EE", "EE" and zero for "EE", "BB", whilst the second will return zero for both, since it's unable to match row by row &lt;STRONG&gt;&lt;EM&gt;in the chart&lt;/EM&gt;&lt;/STRONG&gt; (where same dimension -ColB- have different values EE and BB, although different values in other field like Identifier in the data model, but not used in the chart).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now take the line 5 out o the script and reload. Both expressions will return 1 in the same chart, since value to value comparison is possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or even add a new line with both ColA and ColB with the same value "EE". Again, it will work for both conditional and set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Going back to the text object mentioned above, try now that ColA and ColB have "EE" as values clicking on "EE" in ColA. You will indeed get "EE" (without identifier) instead of the "-" when both are different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, since your analysis requires a line by line (value by value) comparion in the chart, set analysis is not the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this explains how set analysis is used by QlikView when we say it's calculated "once for the whole chart".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 09:49:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256296#M96988</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-06T09:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256297#M96989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for taking the time to write such a detailed answer! You really helped me in understanding the workings of it all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still want to use set analysis to solve my problem, because it performs a lot better than the conditional expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I did was create some extra columns that make the columns I have to compare unique over the whole dataset. This way QlikView knows which values to compare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;MyTest:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key &amp;amp; ColA AS IdentifierA,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key &amp;amp; ColB AS IdentifierB;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key, ColA, ColB, Counter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, AA, BB, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, CC, DD, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, EE, EE, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, FF, GG, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, EE, BB, 1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I used the newly created columns in the set expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;SUM&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;IdentifierA = {"=IdentifierA &amp;lt;= IdentifierB"} &amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Counter&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works excellen and solves my problem. The big plus is that it is really fast when a selection is changed!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again Miguel!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 13:37:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256297#M96989</guid>
      <dc:creator />
      <dc:date>2011-06-06T13:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256298#M96990</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;Glad to help, you're welcome and that you have found your way to change the data model. Just one note, that is that in version 10 exist two relational operators to compare, according to the ASCII table, literals or string values. That is the case of "FOLLOWS" that will return true if the left part has a greater ascii value than the right part:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If('AAA' FOLLOWS 'A', true(), false()) // This will return true&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other one is PRECEDES, that is the opposite case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If('B' PRECEDES 'C', true(), false()) // This will return false&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find those more useful than "&amp;gt;=", "&amp;lt;=" and so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 13:47:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256298#M96990</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-06T13:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256299#M96991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for the extra info!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 13:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256299#M96991</guid>
      <dc:creator />
      <dc:date>2011-06-06T13:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256300#M96992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do a similar set analysis, but can't get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My expression is as follows, and this actually works:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Sum({$&amp;lt;SourceType={'Budget'}, SummaryType=, PeriodStat={'Y'}, Month = {'&amp;lt;= 4'}&amp;gt;} If(AC3='510',&amp;nbsp; BalanceLC)) --&amp;gt; returns the sum of the first 4 months&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Now I would like to make it more flexible and replace the static 4 in the month with a Count(Distinct Month). Whatever I try, it simply does not return the values that I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Sum({$&amp;lt;SourceType={'Budget'}, SummaryType=, PeriodStat={'Y'}, Month = {'&amp;lt;= Count(Distinct Month)'}&amp;gt;} If(AC3='510',&amp;nbsp; BalanceLC))&amp;nbsp; --&amp;gt; returns 0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Sum({$&amp;lt;SourceType={'Budget'}, SummaryType=, PeriodStat={'Y'}, Month = {'=Month &amp;lt;= Count(Distinct Month)'}&amp;gt;} If(AC3='510',&amp;nbsp; BalanceLC))&amp;nbsp; --&amp;gt; returns the first months value only&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;I also tried to use a variable with the expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;x = Count(Distinct Month)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;and then use this variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Sum({$&amp;lt;SourceType={'Budget'}, SummaryType=, PeriodStat={'Y'}, Month = {'&amp;lt;= $(x)'}&amp;gt;} If(AC3='510',&amp;nbsp; BalanceLC))&amp;nbsp; --&amp;gt; returns &lt;SPAN style="font-family: courier new,courier;"&gt;returns the first months value only&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;How can I replace the hardcoded 4?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 03:36:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256300#M96992</guid>
      <dc:creator />
      <dc:date>2014-09-17T03:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Set analysis: ColA &lt;= ColB</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256301#M96993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I just found the solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;=Sum({$&amp;lt;SourceType={'Budget'}, SummaryType=, PeriodStat={'Y'}, Month={'=Count(Distinct Month)'}&amp;gt;} If(AC3='510',&amp;nbsp; BalanceLC))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For some reason, if I use a = instead of &amp;lt;= then it does calculate the sum from 1 - x (i.e. &amp;lt;=)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 04:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-ColA-lt-ColB/m-p/256301#M96993</guid>
      <dc:creator />
      <dc:date>2014-09-17T04:27:21Z</dc:date>
    </item>
  </channel>
</rss>

