<?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: Calculating the support value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118058#M18188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take care Evgeniy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the cross join is made without considering the day,&lt;/P&gt;&lt;P&gt;it works with you example, but doesn't work if same client have different days purchase,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so in script weekday should be add in group by&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Aug 2018 15:49:24 GMT</pubDate>
    <dc:creator>ogautier62</dc:creator>
    <dc:date>2018-08-24T15:49:24Z</dc:date>
    <item>
      <title>Calculating the support value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118055#M18185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got the following &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;sample data set&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Client, Product, Sales&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1, Apple, 100&lt;/P&gt;&lt;P&gt;1, Mango, 200&lt;/P&gt;&lt;P&gt;2, Apple, 100&lt;/P&gt;&lt;P&gt;2, Carrot, 500&lt;/P&gt;&lt;P&gt;3, Mango, 300&lt;/P&gt;&lt;P&gt;4, Carrot, 200&lt;/P&gt;&lt;P&gt;5, Carrot, 100&lt;/P&gt;&lt;P&gt;5, Apple, 300&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Description:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I try to calculate the &lt;STRONG&gt;Support Value&lt;/STRONG&gt;. Support is the number of transactions that include items in the {A} and {B} parts of the rule as a percentage of the total number of transactions:&lt;/P&gt;&lt;P&gt;Support&amp;nbsp; =&amp;nbsp; (A and B) / Total = ("Apple" and "Carrot") / 5 = 2 / 5 = 0.4 (40%)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following expression gets me the correct value in a text box:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=Count(DISTINCT {&amp;lt;Client = &lt;SPAN&gt;p&lt;/SPAN&gt;({&amp;lt;Product = {'Apple'}&amp;gt;})*&lt;SPAN&gt;p&lt;/SPAN&gt;({&amp;lt;Product = {'Carrot'}&amp;gt;})&amp;gt;} Client)/Count(DISTINCT Client)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;On practice it could be much more transactions so I'd like to get some table as an output for top &lt;SPAN&gt;N&lt;/SPAN&gt; combinations (by support) and play around with it using selections. &lt;SPAN style="font-size: 13.3333px;"&gt;Is it possible to do it? (don't want to set the products' names manually to each pair)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Expected output:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;No, Combination, Support&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; "Apple" and "Carrot", 0.4&lt;/P&gt;&lt;P&gt;2,&amp;nbsp; "Apple" and "Mango",&amp;nbsp; 0.2&lt;/P&gt;&lt;P&gt;3,&amp;nbsp; "Carrot" and "Mango", 0.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Evgeniy&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 08:23:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118055#M18185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-24T08:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the support value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118056#M18186</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;here's a first step :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" height="150" src="https://community.qlik.com/legacyfs/online/211723_pastedImage_0.png" style="width: 340px; height: 150.272px;" width="340" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" height="116" src="https://community.qlik.com/legacyfs/online/211757_pastedImage_1.png" style="width: 333px; height: 116.236px;" width="333" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with calculation done in script; 2 new tables :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;item:&lt;/P&gt;&lt;P&gt;load Client, Product resident data;&lt;/P&gt;&lt;P&gt;inner join (item) load Client, Product as p resident item;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;items:&lt;/P&gt;&lt;P&gt;load Client,Product &amp;amp; p as supitem resident item where&amp;nbsp; Product &amp;lt;p ;&lt;/P&gt;&lt;P&gt;drop table item;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;supportitem:&lt;/P&gt;&lt;P&gt;load supitem , count(Client) as compte resident items group by supitem;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can select combination in supitem, that selects Client in your data set&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 13:28:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118056#M18186</guid>
      <dc:creator>ogautier62</dc:creator>
      <dc:date>2018-08-24T13:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the support value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118057#M18187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Hi Olivier,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;It seems awesome! Thank you so much! Especially thanks for the details!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And one more question by the way (even without your last step):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imagine a business question: Which were combinations "affecting" on Friday?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Client, Product, Sales, WeekDay&lt;/P&gt;&lt;P&gt;1, Apple, 100, Thu&lt;/P&gt;&lt;P&gt;1, Mango, 200, Thu&lt;/P&gt;&lt;P&gt;2, Apple, 100, Thu&lt;/P&gt;&lt;P&gt;2, Carrot, 500, Thu&lt;/P&gt;&lt;P&gt;3, Mango, 300, Thu&lt;/P&gt;&lt;P&gt;4, Carrot, 200, Thu&lt;/P&gt;&lt;P&gt;5, Carrot, 100, Fri&lt;/P&gt;&lt;P&gt;5, Apple, 300, Fri&lt;/P&gt;&lt;P&gt;6, Carrot, 100, Fri&lt;/P&gt;&lt;P&gt;6, Apple, 300, Fri&lt;/P&gt;&lt;P&gt;6, Mango, 300, Fri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it be a correct solution based on your example? ( screenshot is attached) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Evgeniy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:23:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118057#M18187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-24T14:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the support value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118058#M18188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take care Evgeniy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the cross join is made without considering the day,&lt;/P&gt;&lt;P&gt;it works with you example, but doesn't work if same client have different days purchase,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so in script weekday should be add in group by&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 15:49:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-support-value/m-p/118058#M18188</guid>
      <dc:creator>ogautier62</dc:creator>
      <dc:date>2018-08-24T15:49:24Z</dc:date>
    </item>
  </channel>
</rss>

