<?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 Current Selection/Previous Selection in Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Current-Selection-Previous-Selection-in-Set-Analysis/m-p/419485#M487004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with the expression used in Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find the ratio of current selection values-to-previous selection values using set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To state the problem precisely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Product Type (6 types)&lt;/P&gt;&lt;P&gt;2. Country ( 10 Countries)&lt;/P&gt;&lt;P&gt;3. Items ( Items for each product type with unique Item ID).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to implement this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Count the total items across all product types and countries.&lt;/P&gt;&lt;P&gt;Step 2: Implement Top-down drill approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a). When I select Product type, it should calculate the ratio of&amp;nbsp; &lt;STRONG&gt;'Number of items of this product'&lt;/STRONG&gt; to &lt;STRONG&gt;'the total items in the inventory'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b). Now, if I select the country, it should calculate the ratio of&amp;nbsp; &lt;STRONG&gt;'Number of items of this product in selected country' &lt;/STRONG&gt;to&lt;STRONG&gt; 'the items for the selected product in&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Step&amp;nbsp; 2(a)'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For this, I used the following expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;= Count( {$} Item) / Count ( {$1} Item)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3: Now, I want to de-select the country.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If I do this, it should calculate or display, the ratio of &lt;STRONG&gt;'Number of items for the selected product'&lt;/STRONG&gt; to &lt;STRONG&gt;'the total items in the inventory'&lt;/STRONG&gt; i.e., Step 2(a) ratio value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In other words, it should &lt;STRONG&gt;&lt;EM&gt;roll back&lt;/EM&gt;&lt;/STRONG&gt; to the previous calculated value. But it is calculating in a different way i.e., if I de-select the country, now the current selection is &lt;STRONG&gt;'Product'&lt;/STRONG&gt; and previous selection is &lt;STRONG&gt;'Product + Country'&lt;/STRONG&gt; which is not desired for calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If I use a &lt;STRONG&gt;'Back'&lt;/STRONG&gt; Button, it is very easy to implement this. But I need to implement without using a BACK button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me in finding a more robust solution to this problem??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated. Thanks for your valuable time !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Mar 2013 16:24:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-03-07T16:24:47Z</dc:date>
    <item>
      <title>Current Selection/Previous Selection in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Selection-Previous-Selection-in-Set-Analysis/m-p/419485#M487004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with the expression used in Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find the ratio of current selection values-to-previous selection values using set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To state the problem precisely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Product Type (6 types)&lt;/P&gt;&lt;P&gt;2. Country ( 10 Countries)&lt;/P&gt;&lt;P&gt;3. Items ( Items for each product type with unique Item ID).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to implement this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Count the total items across all product types and countries.&lt;/P&gt;&lt;P&gt;Step 2: Implement Top-down drill approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a). When I select Product type, it should calculate the ratio of&amp;nbsp; &lt;STRONG&gt;'Number of items of this product'&lt;/STRONG&gt; to &lt;STRONG&gt;'the total items in the inventory'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b). Now, if I select the country, it should calculate the ratio of&amp;nbsp; &lt;STRONG&gt;'Number of items of this product in selected country' &lt;/STRONG&gt;to&lt;STRONG&gt; 'the items for the selected product in&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Step&amp;nbsp; 2(a)'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For this, I used the following expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;= Count( {$} Item) / Count ( {$1} Item)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3: Now, I want to de-select the country.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If I do this, it should calculate or display, the ratio of &lt;STRONG&gt;'Number of items for the selected product'&lt;/STRONG&gt; to &lt;STRONG&gt;'the total items in the inventory'&lt;/STRONG&gt; i.e., Step 2(a) ratio value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In other words, it should &lt;STRONG&gt;&lt;EM&gt;roll back&lt;/EM&gt;&lt;/STRONG&gt; to the previous calculated value. But it is calculating in a different way i.e., if I de-select the country, now the current selection is &lt;STRONG&gt;'Product'&lt;/STRONG&gt; and previous selection is &lt;STRONG&gt;'Product + Country'&lt;/STRONG&gt; which is not desired for calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If I use a &lt;STRONG&gt;'Back'&lt;/STRONG&gt; Button, it is very easy to implement this. But I need to implement without using a BACK button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me in finding a more robust solution to this problem??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated. Thanks for your valuable time !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 16:24:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Selection-Previous-Selection-in-Set-Analysis/m-p/419485#M487004</guid>
      <dc:creator />
      <dc:date>2013-03-07T16:24:47Z</dc:date>
    </item>
  </channel>
</rss>

