<?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 Counting valid subscriptions on months last day in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553373#M206755</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;I have linked subscription data to mastercalendar, and I'm trying to achieve something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim 1 : MasterCalendar.Year&lt;/P&gt;&lt;P&gt;Dim 2 : MasterCalendar.Month&lt;/P&gt;&lt;P&gt;Expr 1 : SUM( Subs.Sales )&lt;/P&gt;&lt;P&gt;Expr 2 : Count( Distinct Subs.Id )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&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;Year&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;Month&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;Sales&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;Active subscriptions&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;255&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;343&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;36&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;856&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, that when the business folk talk about "number of subscriptions", they mean the amount of active subscriptions on the last day of the month in question (ie. do not count the subscriptions that ended before the last day of the month).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get count of only the last day instead of the count of the whole month?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using set analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count( {MasterCalendar.Date = {$(=...get last day of month when year = dim 1 and month = dim 2...)}} distinct Subs.Id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as far as I can tell, you can't use dimensions with the set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How should I solve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Oct 2013 07:12:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-31T07:12:23Z</dc:date>
    <item>
      <title>Counting valid subscriptions on months last day</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553373#M206755</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;I have linked subscription data to mastercalendar, and I'm trying to achieve something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim 1 : MasterCalendar.Year&lt;/P&gt;&lt;P&gt;Dim 2 : MasterCalendar.Month&lt;/P&gt;&lt;P&gt;Expr 1 : SUM( Subs.Sales )&lt;/P&gt;&lt;P&gt;Expr 2 : Count( Distinct Subs.Id )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&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;Year&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;Month&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;Sales&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;Active subscriptions&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;255&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;343&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;36&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;856&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, that when the business folk talk about "number of subscriptions", they mean the amount of active subscriptions on the last day of the month in question (ie. do not count the subscriptions that ended before the last day of the month).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get count of only the last day instead of the count of the whole month?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using set analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count( {MasterCalendar.Date = {$(=...get last day of month when year = dim 1 and month = dim 2...)}} distinct Subs.Id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as far as I can tell, you can't use dimensions with the set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How should I solve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 07:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553373#M206755</guid>
      <dc:creator />
      <dc:date>2013-10-31T07:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Counting valid subscriptions on months last day</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553374#M206756</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;Use master calender date for calulation of last day of month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. =&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MonthEnd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='',&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 07:22:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553374#M206756</guid>
      <dc:creator />
      <dc:date>2013-10-31T07:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Counting valid subscriptions on months last day</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553375#M206757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the following work around&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script, create one more table like below&lt;/P&gt;&lt;P&gt;MonthlySubscription:&lt;/P&gt;&lt;P&gt;Load Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(Date) as LastDay&lt;/P&gt;&lt;P&gt;Resident MasterCalendar GroupBy Year, Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (MonthlySubscription) Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date as LastDay,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(Distinct SubsID) as SubscriptionCount&lt;/P&gt;&lt;P&gt;Resident FACT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in your expression you can use Sum(SubscriptionCount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 08:05:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553375#M206757</guid>
      <dc:creator />
      <dc:date>2013-10-31T08:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Counting valid subscriptions on months last day</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553376#M206758</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;"&gt;hi mika,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;try this &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;"&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;"&gt;Count( {&amp;lt;Year={$(=Max(Year)},Month={$(=Max(month)},week={$(=max(week)},Day={$(=max(Day-1)}&amp;gt;}Distinct &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Subs.Id&lt;/SPAN&gt; )&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 09:03:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-valid-subscriptions-on-months-last-day/m-p/553376#M206758</guid>
      <dc:creator>preminqlik</dc:creator>
      <dc:date>2013-10-31T09:03:52Z</dc:date>
    </item>
  </channel>
</rss>

