<?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 Expression problem (AND, OR) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274151#M102569</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 do this like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(even(GamingTransaction.runner_id),1,0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as GamingTransaction.runner_id_EvenFlag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$ &amp;lt; GamingTransaction.game_tran_type={commission}, UserMembership.com_percentage{50}&amp;gt; } GamingTransaction.amount*GamingTransaction.runner_id_EvenFlag)/2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Succes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Halmar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Oct 2011 17:38:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-10-25T17:38:26Z</dc:date>
    <item>
      <title>Set Analysis Expression problem (AND, OR)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274148#M102566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just getting to grips with set analysis and am having some difficulty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is my expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$ &amp;lt; GamingTransaction.game_tran_type={commission},UserMembership.com_percentage={50} &amp;gt; } GamingTransaction.amount/2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find all GamingTransactions which have 'commission' as their 'game_tran_type' and also have a UserMembership.com_percentage with a value of '50', and sum the amounts of these GamingTransactions and divide the result by 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I can tell, the above expression gives me the GamingTransaction amounts of those with a GamingTransaction.game_tran_type={commission} OR those which have a UserMembership.com_percentage={50}. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I change the expression so that the resulting GamingTransactions have both attributes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 14:27:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274148#M102566</guid>
      <dc:creator />
      <dc:date>2011-10-25T14:27:06Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Expression problem (AND, OR)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274149#M102567</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;In the syntax of set analysis you give the extra selections that must be made for this expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it is always an "and" situation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Halmar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 14:53:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274149#M102567</guid>
      <dc:creator />
      <dc:date>2011-10-25T14:53:18Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Expression problem (AND, OR)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274150#M102568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halmar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for getting back to me again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok, that seems to be working, I may have just been wrong before. But now I would like to insert a function into my set analysis to check whether a number is Odd or Even, like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$ &amp;lt; GamingTransaction.game_tran_type={commission}, UserMembership.com_percentage{50}, Even(GamingTransaction.runner_id) &amp;gt; } GamingTransaction.amount/2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am getting an error in my expression syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible, to put a function into the set analysis? If so, do you know the syntax for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 15:01:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274150#M102568</guid>
      <dc:creator />
      <dc:date>2011-10-25T15:01:52Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Expression problem (AND, OR)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274151#M102569</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 do this like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(even(GamingTransaction.runner_id),1,0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as GamingTransaction.runner_id_EvenFlag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$ &amp;lt; GamingTransaction.game_tran_type={commission}, UserMembership.com_percentage{50}&amp;gt; } GamingTransaction.amount*GamingTransaction.runner_id_EvenFlag)/2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Succes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Halmar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 17:38:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-problem-AND-OR/m-p/274151#M102569</guid>
      <dc:creator />
      <dc:date>2011-10-25T17:38:26Z</dc:date>
    </item>
  </channel>
</rss>

