<?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 Sub-selections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sub-selections/m-p/250397#M499477</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 have two tables in QlikView that more or less look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Transactions&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Columns: &lt;EM&gt;Transaction_id&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Data&lt;EM&gt;:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TransactionRecords&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Columns:&lt;EM&gt; Transactionrecord_id,Transaction_id,ProductDescription,Discount_id,Quantity,GrossAmount&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1,1,A,NULL,1,4&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;2,1,E,NULL,1,4&lt;/EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;3,1,B,NULL,1,4&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;4,2,A,1,1,3&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;5,2,C,NULL,1,4&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;6,2,D,NULL,1,4&lt;/EM&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;7,3,B,2,1,2&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;8,3,C,NULL,1,4&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;9,3,A,1,1,3&lt;/EM&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example I have three transactions:&lt;/P&gt;&lt;P&gt;Transaction #1 has three records and neither of those records have a discount applied to them.&lt;/P&gt;&lt;P&gt;Transaction #2 has three records and the first record has a discount (Discount_id) applied to it.&lt;/P&gt;&lt;P&gt;Transaction #3 has three records and two of those records have a (different) discount applied to them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now want to achieve the following:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If i select Discount_id&amp;nbsp; =1, then I want to see a list of all articles that are in a transaction that has one ore more transactionrecords with a Discount_id =1 &lt;STRONG&gt;excluding &lt;/STRONG&gt;the ProductDescription that has a Discount applied. So in this case I want Qlikview to return B,C &amp;amp; D.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me a push into the right direction. I'm guessing I should use a P() statement somewhere in my expression, but so far this is the only thing that I've come up with:&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;Transaction_id = P({1} Discount_id )&amp;gt;} Quantity )&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 May 2011 11:13:53 GMT</pubDate>
    <dc:creator>valkbart</dc:creator>
    <dc:date>2011-05-30T11:13:53Z</dc:date>
    <item>
      <title>Sub-selections</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-selections/m-p/250397#M499477</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 have two tables in QlikView that more or less look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Transactions&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Columns: &lt;EM&gt;Transaction_id&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Data&lt;EM&gt;:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TransactionRecords&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Columns:&lt;EM&gt; Transactionrecord_id,Transaction_id,ProductDescription,Discount_id,Quantity,GrossAmount&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1,1,A,NULL,1,4&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;2,1,E,NULL,1,4&lt;/EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;3,1,B,NULL,1,4&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;4,2,A,1,1,3&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;5,2,C,NULL,1,4&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;6,2,D,NULL,1,4&lt;/EM&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;7,3,B,2,1,2&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;8,3,C,NULL,1,4&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;9,3,A,1,1,3&lt;/EM&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example I have three transactions:&lt;/P&gt;&lt;P&gt;Transaction #1 has three records and neither of those records have a discount applied to them.&lt;/P&gt;&lt;P&gt;Transaction #2 has three records and the first record has a discount (Discount_id) applied to it.&lt;/P&gt;&lt;P&gt;Transaction #3 has three records and two of those records have a (different) discount applied to them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now want to achieve the following:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If i select Discount_id&amp;nbsp; =1, then I want to see a list of all articles that are in a transaction that has one ore more transactionrecords with a Discount_id =1 &lt;STRONG&gt;excluding &lt;/STRONG&gt;the ProductDescription that has a Discount applied. So in this case I want Qlikview to return B,C &amp;amp; D.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me a push into the right direction. I'm guessing I should use a P() statement somewhere in my expression, but so far this is the only thing that I've come up with:&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;Transaction_id = P({1} Discount_id )&amp;gt;} Quantity )&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 11:13:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-selections/m-p/250397#M499477</guid>
      <dc:creator>valkbart</dc:creator>
      <dc:date>2011-05-30T11:13:53Z</dc:date>
    </item>
  </channel>
</rss>

