<?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: Indirect set analysis, nr of users in a month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141344#M464048</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe a somewhat different approach will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on a couple of assumptions I think you can solve this requirement within the script. The main assumption is that the Hour declaration is administrated per user by date. Use the declaration date to link to the master calendar. For every date you now have the hours declared per user. The actual number of users each month is a simple &lt;EM&gt;count(distinct USER_NUMBER)&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;The source of Revenue isn’t clear to me, but I assume that is has something to do with the number of declared hours, so &lt;EM&gt;Sum(NROFHOURS)&lt;/EM&gt; should do the trick. Divide the Sum(NROFHOURS) by the count(distinct USER_NUMBER) (if needed do a rangesum / rangecount) and you’re there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that you checkif the NROFHOURS &amp;gt; 0. If these records aren’t needed, skip these when loading the declared hours records. If these records can’t be skipped, create an indicator like &lt;EM&gt;If(NROFHOURS = 0,1,0) as IndNoHours&lt;/EM&gt; and use this indicator in a set analyses to rule them out from the calculation (something like count({&amp;lt;IndNoHours = {0}&amp;gt;} distinct USER_NUMBER).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michiel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 May 2016 12:10:20 GMT</pubDate>
    <dc:creator>mvanlutterveld</dc:creator>
    <dc:date>2016-05-13T12:10:20Z</dc:date>
    <item>
      <title>Indirect set analysis, nr of users in a month</title>
      <link>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141341#M464045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to calculate the number of users that declared hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hour data is in column:&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NROFHOURS&lt;/P&gt;&lt;P&gt;The unique employee is in column: %FK_USER&amp;nbsp;&amp;nbsp;&amp;nbsp; which links to the User dimension (from which I use USER_NUMBER &amp;gt;&amp;gt;&amp;gt;)&lt;/P&gt;&lt;P&gt;The data is stored on daily basis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to devide the (rangesum) revenue by the actual number of users in each month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a master calendar table with Dimension Year-Month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A running sum for the revenue:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;rangesum(above(sum({&amp;lt;Year&amp;gt;}REVENUE), 0 ,12))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I constructed this set analysis but I the results are higher than the number of users that entered hours.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Count({1&amp;lt;USER_NUMBER=P({1&amp;lt;NROFHOURS={"&amp;gt;0"}&amp;gt;}USER_NUMBER)&amp;gt;}USER_NUMBER)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I expected this&amp;nbsp; expression to aggregate over the Dimension Year-Month but that is not the case, given the higher number of users than acutally exists in the data.&lt;/P&gt;&lt;P&gt;Adding Distinct to the set analysis didn't change anything.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;Count(Distinct {1&amp;lt;USER_NUMBER=P({1&amp;lt;NROFHOURS={"&amp;gt;0"}&amp;gt;}USER_NUMBER)&amp;gt;}USER_NUMBER)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;Please advise&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 11:36:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141341#M464045</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2016-05-13T11:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Indirect set analysis, nr of users in a month</title>
      <link>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141342#M464046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You used a 1 as set identifier which meant that selections/dimensions will be ignored - try it without the 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 11:54:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141342#M464046</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-13T11:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Indirect set analysis, nr of users in a month</title>
      <link>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141343#M464047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;both or just the 1 in the P part?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 11:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141343#M464047</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2016-05-13T11:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Indirect set analysis, nr of users in a month</title>
      <link>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141344#M464048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe a somewhat different approach will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on a couple of assumptions I think you can solve this requirement within the script. The main assumption is that the Hour declaration is administrated per user by date. Use the declaration date to link to the master calendar. For every date you now have the hours declared per user. The actual number of users each month is a simple &lt;EM&gt;count(distinct USER_NUMBER)&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;The source of Revenue isn’t clear to me, but I assume that is has something to do with the number of declared hours, so &lt;EM&gt;Sum(NROFHOURS)&lt;/EM&gt; should do the trick. Divide the Sum(NROFHOURS) by the count(distinct USER_NUMBER) (if needed do a rangesum / rangecount) and you’re there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that you checkif the NROFHOURS &amp;gt; 0. If these records aren’t needed, skip these when loading the declared hours records. If these records can’t be skipped, create an indicator like &lt;EM&gt;If(NROFHOURS = 0,1,0) as IndNoHours&lt;/EM&gt; and use this indicator in a set analyses to rule them out from the calculation (something like count({&amp;lt;IndNoHours = {0}&amp;gt;} distinct USER_NUMBER).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michiel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 12:10:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141344#M464048</guid>
      <dc:creator>mvanlutterveld</dc:creator>
      <dc:date>2016-05-13T12:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Indirect set analysis, nr of users in a month</title>
      <link>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141345#M464049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends on your objects/selections but I would at first remove both and then check the expression-results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 12:10:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Indirect-set-analysis-nr-of-users-in-a-month/m-p/1141345#M464049</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-13T12:10:59Z</dc:date>
    </item>
  </channel>
</rss>

