<?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: Weighted Distribution in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130981#M603061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure I understand... why do you have Sales in both the tables? How do you get 2800 from the data you have provided?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jul 2018 15:33:31 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-07-31T15:33:31Z</dc:date>
    <item>
      <title>Weighted Distribution</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130978#M603057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a client requirement to calculate the weighted Distribution of an Product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Weighted Distribution -Sum of &lt;SPAN style="font-size: 10pt;"&gt;Sales of Stores selling the product by the Total Sales of all Stores.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;We have to breakdown the Weighted Distribution on Products but I am struck in the expression for Numerator i.e. Sum of Sales of Stores selling the product.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I am able to write the expression to calculate the weighted Distribution for consolidated Product but when I have to breakdown the same to show the Weighted Distribution for each Product its giving me the Sum of sales of Product not the sum of Sales of Stores selling the product.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Below is the expression for WD for consolidated Products, which is working fine:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Numerator&lt;/STRONG&gt; - sum({1&amp;lt;PickLevel = {"Total Store"},$(=$(vSetAnalysisCurrentPeriod)),storeid={$(=chr(39) &amp;amp; concat(distinct storeid,chr(39)&amp;amp;','&amp;amp;chr(39)) &amp;amp; chr(39))}&amp;gt;} $(=$(Sales))))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Denominator&lt;/STRONG&gt; - SUM({&amp;lt; PickLevel = {"Total Store"}, &amp;gt;} $(=$(Sales)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="294"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="19" width="53"&gt;Product&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="49"&gt;Storeid&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="78"&gt;Picklevel&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="37"&gt;Sales&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="77"&gt;No Prod cat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Total Stores&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;All Shop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Total Stores&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;All Shop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;C&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Total Stores&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;34&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Non Shop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Total Stores&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;36&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;All Shop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Total Stores&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;65&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;All Shop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;D&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Total Stores&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;456&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;All Shop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Total Stores&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;64&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Non Shop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;D&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;Total Stores&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;34&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;All Shop&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Can someone help me to write the expression.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 17:55:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130978#M603057</guid>
      <dc:creator>ajitkjain</dc:creator>
      <dc:date>2018-07-26T17:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Distribution</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130979#M603058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not entirely sure I understand, but may be try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({1&amp;lt;PickLevel = {"Total Store"}, $(=$(vSetAnalysisCurrentPeriod)), storeid = p(storeid)&amp;gt;} $(=$(Sales))))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 18:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130979#M603058</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-07-26T18:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Distribution</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130980#M603060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick respond for my query, but is still not fulfilling my query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer the below sample data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" width="64"&gt;Product&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Store&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;C&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;C&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;70&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;D&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;80&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" style="border-top: none;"&gt;D&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 150px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" width="86"&gt;Store&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="19" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="19" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;5000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="19" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;800&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="19" style="border-top: none;"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="19" style="border-top: none;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;Sum&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;10300&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now WD for Product A will be (2800/10300)*100 = 66.019%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had written the expression as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({store =&amp;lt;P({1&amp;lt;prod = {'A'}&amp;gt;}store)&amp;gt;}Sales) - But its not giving me correct output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me to help me what is wrong in this expression or with the new expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2018 09:52:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130980#M603060</guid>
      <dc:creator>ajitkjain</dc:creator>
      <dc:date>2018-07-31T09:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Distribution</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130981#M603061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure I understand... why do you have Sales in both the tables? How do you get 2800 from the data you have provided?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2018 15:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130981#M603061</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-07-31T15:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Distribution</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130982#M603062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Second Table contains the Sales of different stores and the first table contains the Sales of Product sold on different stores.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please rename the column Sales from 2nd Table as "StoreSales"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let suppose I have to calculate the weighted distribution for Product A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WD of Prod A = Sum of sales of all the stores where product A is being sold / sum of sales of all the stores.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in my data Product A is being sold on 3 stores i.e. 1,2,3 so Numerator value consists of the sum of sales of these 3 stores where product A is being sold.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2018 17:40:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130982#M603062</guid>
      <dc:creator>ajitkjain</dc:creator>
      <dc:date>2018-08-01T17:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Distribution</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130983#M603063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the solution to my problem. Thank you for suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 07:53:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-Distribution/m-p/130983#M603063</guid>
      <dc:creator>ajitkjain</dc:creator>
      <dc:date>2018-08-07T07:53:41Z</dc:date>
    </item>
  </channel>
</rss>

