<?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 based on a dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995152#M338726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for confirming my suspicion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Sep 2015 20:09:02 GMT</pubDate>
    <dc:creator>Rich-HHE</dc:creator>
    <dc:date>2015-09-21T20:09:02Z</dc:date>
    <item>
      <title>Set analysis based on a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995148#M338722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm new to set analysis and have read dozens of examples online and I cannot quite figure out how to do the following. I have a separate table of reporting months, not related to the sales table on any field. I did this intentionally since I don't want to select sales data based on this dimension. However, maybe there is a way to do that I'm not seeing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;My Reporting Month Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;MONTH_BEGIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;2015-01-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;2015-02-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;2015-03-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;... and so on&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For each reporting month, I need to know (product examples are made up of course):&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;How many customers purchased a SHOE within the prior 18 months&lt;/LI&gt;&lt;LI&gt;How many customers did &lt;STRONG&gt;not ever&lt;/STRONG&gt; purchase a SHOE &lt;SPAN style="text-decoration: underline;"&gt;prior to the reporting month&lt;/SPAN&gt;, AND did &lt;STRONG&gt;not ever&lt;/STRONG&gt; purchase SOCKS prior to the reporting month, but &lt;STRONG&gt;did purchase&lt;/STRONG&gt; LACES any time prior to the reporting month. Obviously ignoring what happened &lt;EM&gt;after&lt;/EM&gt; each reporting month for that row only.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting table would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="139" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid rgb(0, 0, 0); width: 330px; height: 107px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;MONTH_BEGIN&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SHOE LAST 18 MONTHS&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Never Shoe Prior, Never Socks Prior, Purchased Laces Prior&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2015-01-01&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;7,544&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;18,495&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2015-02-01&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;7,850&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;18,400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2015-03-01&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;7,900&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;18,359&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is one of the set analysis expression I've been trying. But I think the set analysis doesn't work with an unrelated field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=Count(DISTINCT {$&amp;lt;PRODUCT_GROUP={SHOE},AMOUNT_ORDER={"&amp;gt;0"},MONTH_BEGIN={"&amp;lt;=$(=AddMonths(DATE_BEST,-18))"}&amp;gt;} CUSTOMER)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 17:38:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995148#M338722</guid>
      <dc:creator>Rich-HHE</dc:creator>
      <dc:date>2015-09-21T17:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis based on a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995149#M338723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set Analysis calculated once per chart, not per line. So you need to calculate this in script.&lt;/P&gt;&lt;P&gt;Provide sample data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:19:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995149#M338723</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-09-21T18:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis based on a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995150#M338724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Manish mentioned, Set Analysis cannot directly refer to the Dimension values because it's calculated only once per chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the trick is to create the desired database associations and generate conditional flags that can be perceived as "static" in Set Analysis. When it comes to dates, the commonly used solution is the "As of Date" table - you create a calendar with the "display" dates and then build a table that associates the "display" dates with the "transaction" dates using conditional flags.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example: all the "transaction" dates that fall within the last month, compared to the "display" dates, will be marked with _LastMonth_Flag = 1 and all other transaction dates will have _LastMonth_Flag=0. Now, your Set Analysis expression is rather simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_LastMonth_Flag = {1}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read a more detailed description of the As of Date table in this blog article:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.naturalsynergies.com/q-tip-4-how-to-use-as-of-date-table/" title="http://www.naturalsynergies.com/q-tip-4-how-to-use-as-of-date-table/"&gt;QlikView Blog Q-Tip #4 How to Use "As of Date" table | Natural Synergies&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, you can find even more details in my new book &lt;EM&gt;QlikView Your Business&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=HEF4KYLLE22XIQH2"&gt;QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense&lt;/A&gt;&lt;IMG alt="" border="0" height="1" src="http://ir-na.amazon-adsystem.com/e/ir?t=natursyner0f-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=1118949552" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 19:53:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995150#M338724</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-09-21T19:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis based on a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995151#M338725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the link and the commonly used term for this situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 20:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995151#M338725</guid>
      <dc:creator>Rich-HHE</dc:creator>
      <dc:date>2015-09-21T20:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis based on a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995152#M338726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for confirming my suspicion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 20:09:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-based-on-a-dimension/m-p/995152#M338726</guid>
      <dc:creator>Rich-HHE</dc:creator>
      <dc:date>2015-09-21T20:09:02Z</dc:date>
    </item>
  </channel>
</rss>

