<?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 Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808449#M285383</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ruben! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2015 14:26:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-30T14:26:26Z</dc:date>
    <item>
      <title>Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808442#M285376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a Sales and Inventory QVW document in which we have a tab where you can select a year,month and week number from a list box. Also we have a Multi Box for selecting information related to a Product like - SKU number, Product Class etc. We have another Multi Box for information related to Store like - Store Number, Store Name etc.&lt;/P&gt;&lt;P&gt;There is a Pivot Chart which reflects the change in data according to the selections made in these list boxes and Multi Boxes. The Pivot Chart has the following columns - Date Range (Week), Sales for current year and Inventory for current year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; I want to be able to pick a Product SKU and a week number that will c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;When selected a SKU - '500'&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;IMG __jive_id="82147" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/82147_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; text-decoration: underline;"&gt;&lt;STRONG&gt;What I want to achieve:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When selected SKU - '500' and then pick a store number - '309'. The store 309 had no transactions but we still want to see the Total Inventory although the Sales would show 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="82148" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/82148_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;What's not Working:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because there were no transaction in that store, all the selections get dis-selected&amp;nbsp; and the Inventory changes to 0 too. And we don't want this to change to 0. It should still show 100.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="82149" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/82149_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this? So if there were no transactions in that particular store, the sales should change to 0 but the Inventory should not. It should still show the Total Inventory irrespective of the Store selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; INVENTORY TY is a metric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this can be achieved using Set Analysis but I'm not sure how to implement it. Thanks for your help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 16:31:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808442#M285376</guid>
      <dc:creator />
      <dc:date>2015-03-27T16:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808443#M285377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vidit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are correct, this can be achieved with set analysis. The will want update your Inventory measure calculation to use something similar to the following expression, updating the Store ID to your field name as appropriate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM( &lt;STRONG&gt;{$&amp;lt;[&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;STORE ID&lt;/SPAN&gt;]=&amp;gt;}&lt;/STRONG&gt; [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;INVENTORY TY])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The part highlighted in bold is the set analysis that you will want to add to your aggregation calculation so that store selections are disregarded for the measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reply or update post if this helps or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 16:56:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808443#M285377</guid>
      <dc:creator />
      <dc:date>2015-03-27T16:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808444#M285378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steven,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for a quick reply! I tried to add the set analysis part you gave above to my metric calculation (which is also a set analysis function) but did not seem to work. Am I doing anything wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So Store_Key is the primary key of my Store table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Original Metric Calculation:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} FIELD_INV_CURRENT) + sum({$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} WAREHOUSE_INV) + sum({$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} FIELD_INTRANSIT) + sum({$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} WH_INTRANSIT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Added your set analysis:&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; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;{$&amp;lt;[STORE_KEY]=&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[STORE_KEY]=&amp;gt;}{$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} FIELD_INV_CURRENT) + sum({$&amp;lt;[STORE_KEY]=&amp;gt;}{$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} WAREHOUSE_INV) + sum({$&amp;lt;[STORE_KEY]=&amp;gt;}{$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} FIELD_INTRANSIT) + sum({$&amp;lt;[STORE_KEY]=&amp;gt;}{$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} WH_INTRANSIT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vidit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 20:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808444#M285378</guid>
      <dc:creator />
      <dc:date>2015-03-27T20:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808445#M285379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vidit, syntax should be:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Set analysis&amp;gt;} Field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're using this syntax, wich is wrong:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Set analysis&amp;gt;}{&amp;lt;Set analysis&amp;gt;} Field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, it should be:&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[STORE_KEY]=, inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} FIELD_INV_CURRENT)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 20:52:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808445#M285379</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-03-27T20:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808446#M285380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ruben! But it did not work. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 21:13:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808446#M285380</guid>
      <dc:creator />
      <dc:date>2015-03-27T21:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808447#M285381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vidit, you changed the rest of the expression? Mine was only an example in the first Sum, but all the other must be changed in the same way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, this wouldn't solve your problem with de-selecting when you select a store without sales, it should need a more complex solution, generating missing data or finding a way that keeps relation between products and stores even if they have no sales of that particular product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link, maybe it helps you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3786"&gt;Generating Missing Data In QlikView&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 21:30:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808447#M285381</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-03-27T21:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808448#M285382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Vidit!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you attach your model?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Mar 2015 05:48:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808448#M285382</guid>
      <dc:creator>pokassov</dc:creator>
      <dc:date>2015-03-28T05:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808449#M285383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ruben! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 14:26:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808449#M285383</guid>
      <dc:creator />
      <dc:date>2015-03-30T14:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808450#M285384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Capren! I'm not sure how to attach a qvw to this post. But this is the calculation I was using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;sum({$&amp;lt;[STORE_KEY]=&amp;gt;}{$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} FIELD_INV_CURRENT) + sum({$&amp;lt;[STORE_KEY]=&amp;gt;}{$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} WAREHOUSE_INV) + sum({$&amp;lt;[STORE_KEY]=&amp;gt;}{$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} FIELD_INTRANSIT) + sum({$&amp;lt;[STORE_KEY]=&amp;gt;}{$&amp;lt;inv_retail_year={$(=max(Total retail_year))}, inv_retail_week_num={$(=min(Total retail_week_num))}&amp;gt;} WH_INTRANSIT)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 14:32:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808450#M285384</guid>
      <dc:creator />
      <dc:date>2015-03-30T14:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808451#M285385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ruben, yes I did change the whole expression accordingly but it did not work either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 15:19:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Question/m-p/808451#M285385</guid>
      <dc:creator />
      <dc:date>2015-03-30T15:19:57Z</dc:date>
    </item>
  </channel>
</rss>

