<?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 Count salesdays in multiple dimensions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-salesdays-in-multiple-dimensions/m-p/1286840#M402829</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've been looking for a solution for the following problem in Qlikview:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Month to Date reports, I want to compare Sales of this month with the month last year (Mont to Date). The thing is, our sector there are big fluctuations in Sales between days and on top of that, some but not all, branches are open in weekends. So for good comparison, I want to be able to show the number of "Salesdays". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have defined a Saleday as a day with at least € 1000 sales on a given day, per branch. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a number of branches in different countries. A number of those are being managed by a Salesmanager, who are in turn managed by Salesdirectors.&lt;/P&gt;&lt;P&gt;This means that a Salesmanager who governs 5 branches must have 5000 euro Sales on that day to count as a SaleDay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In charts, I am using a variable so that when you click a Sales Director, you see the managers he governs, and when you click a manager, you can see his branches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unforunately I am not getting the right results for Salesdays on all levels. Currently I am using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT(DISTINCT IF(&amp;nbsp; AGGR(SUM([Sales])&amp;gt;(1000*COUNT(DISTINCT Hub.Name)),%Base) AND InMonthToDate(Date,vMaxDate,0), Date))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this expression Hub.NAME are branches and %Base is the key of the salestable where every date&amp;amp;Hub.Name combination is a distinct key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression works for the lowest level (branches) but does not get the right results on the Sales director and Sales manager level. It still seems to work with the 1000 euro, instead of, for instance, 5000 for a manager with 5 branches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I not ussing AGGR correctly? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2016 08:55:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-12-06T08:55:07Z</dc:date>
    <item>
      <title>Count salesdays in multiple dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Count-salesdays-in-multiple-dimensions/m-p/1286840#M402829</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've been looking for a solution for the following problem in Qlikview:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Month to Date reports, I want to compare Sales of this month with the month last year (Mont to Date). The thing is, our sector there are big fluctuations in Sales between days and on top of that, some but not all, branches are open in weekends. So for good comparison, I want to be able to show the number of "Salesdays". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have defined a Saleday as a day with at least € 1000 sales on a given day, per branch. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a number of branches in different countries. A number of those are being managed by a Salesmanager, who are in turn managed by Salesdirectors.&lt;/P&gt;&lt;P&gt;This means that a Salesmanager who governs 5 branches must have 5000 euro Sales on that day to count as a SaleDay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In charts, I am using a variable so that when you click a Sales Director, you see the managers he governs, and when you click a manager, you can see his branches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unforunately I am not getting the right results for Salesdays on all levels. Currently I am using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT(DISTINCT IF(&amp;nbsp; AGGR(SUM([Sales])&amp;gt;(1000*COUNT(DISTINCT Hub.Name)),%Base) AND InMonthToDate(Date,vMaxDate,0), Date))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this expression Hub.NAME are branches and %Base is the key of the salestable where every date&amp;amp;Hub.Name combination is a distinct key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression works for the lowest level (branches) but does not get the right results on the Sales director and Sales manager level. It still seems to work with the 1000 euro, instead of, for instance, 5000 for a manager with 5 branches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I not ussing AGGR correctly? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 08:55:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-salesdays-in-multiple-dimensions/m-p/1286840#M402829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-06T08:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Count salesdays in multiple dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Count-salesdays-in-multiple-dimensions/m-p/1286841#M402830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;1000*COUNT(DISTINCT Hub.Name)&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This will always be calculated inside the aggr at the level that you specified namely %Base. If you want to calculate it at a different level like Salesmanager then you need to add the test for it at that level.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 09:03:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-salesdays-in-multiple-dimensions/m-p/1286841#M402830</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-12-06T09:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count salesdays in multiple dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Count-salesdays-in-multiple-dimensions/m-p/1286842#M402831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you&amp;nbsp; post sample app/ data with desired output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 09:06:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-salesdays-in-multiple-dimensions/m-p/1286842#M402831</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-12-06T09:06:39Z</dc:date>
    </item>
  </channel>
</rss>

