<?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: different result I got between using &amp;quot;if&amp;quot; clause and set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/different-result-I-got-between-using-quot-if-quot-clause-and-set/m-p/493240#M184491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assigned a uniq_id to each and get the correct result. &lt;/P&gt;&lt;P&gt;Learnt a lot. Thanks so much~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jul 2013 06:56:52 GMT</pubDate>
    <dc:creator>gzboy008</dc:creator>
    <dc:date>2013-07-18T06:56:52Z</dc:date>
    <item>
      <title>different result I got between using "if" clause and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/different-result-I-got-between-using-quot-if-quot-clause-and-set/m-p/493238#M184489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; It makes me a puzzle by this example case why I got different result in Qlikview by using "if" clause versus set analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first formula is using "if" clause, this is what I want. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;transaction_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;nodistinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;maxstring&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;agency_contract_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;agent&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;amount&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second formula is using set analysis. The result is beyond my expectation, the result is different from the first formula.&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;transaction_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"=transaction_date&amp;lt;=aggr(nodistinct maxstring(agency_contract_date),agent)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;} &amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;amount&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody illustrate to me why the result is different? How can I achieve the same result by using set analysis?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="44157" class="jive-image-thumbnail jive-image" height="236" onclick="" alt="untitled.bmp" src="https://community.qlik.com/legacyfs/online/44157_untitled.bmp" width="892" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 01:44:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/different-result-I-got-between-using-quot-if-quot-clause-and-set/m-p/493238#M184489</guid>
      <dc:creator>gzboy008</dc:creator>
      <dc:date>2013-07-18T01:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: different result I got between using "if" clause and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/different-result-I-got-between-using-quot-if-quot-clause-and-set/m-p/493239#M184490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw for an explanation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 06:09:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/different-result-I-got-between-using-quot-if-quot-clause-and-set/m-p/493239#M184490</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-07-18T06:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: different result I got between using "if" clause and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/different-result-I-got-between-using-quot-if-quot-clause-and-set/m-p/493240#M184491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assigned a uniq_id to each and get the correct result. &lt;/P&gt;&lt;P&gt;Learnt a lot. Thanks so much~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 06:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/different-result-I-got-between-using-quot-if-quot-clause-and-set/m-p/493240#M184491</guid>
      <dc:creator>gzboy008</dc:creator>
      <dc:date>2013-07-18T06:56:52Z</dc:date>
    </item>
  </channel>
</rss>

