<?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: Sum data if a month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714368#M476054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check the PFA may be it will fulfill your requirement.. !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jun 2014 09:58:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-20T09:58:47Z</dc:date>
    <item>
      <title>Sum data if a month</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714364#M476050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my model, I have a fact table associated to a Calender dimension using a date. The Calendar dimension have some columns like date, week, month, year and many others. The fact table has one date number of visitor with some another dimension column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to Sum the number of visitor &lt;SPAN class="long_text" lang="en"&gt;&lt;SPAN class="hps"&gt;only&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for the month&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;corresponding to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the largest&lt;/SPAN&gt; date &lt;SPAN class="hps"&gt;lying&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;fact&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;table.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="long_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="long_text" lang="en"&gt;&lt;SPAN class="hps"&gt;When I wrote a set analysis where I sum only for the last date using the MAX statement but I don't reach to do with the max month &lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="long_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="long_text" lang="en"&gt;&lt;SPAN class="hps"&gt;How could I do it please ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="long_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="long_text" lang="en"&gt;&lt;SPAN class="hps"&gt;Thanks.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="long_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2014 20:56:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714364#M476050</guid>
      <dc:creator />
      <dc:date>2014-06-19T20:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sum data if a month</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714365#M476051</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;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Date = {"&amp;gt;=$(=MonthStart(Max(Date)))&amp;lt;=$(=Max(Date))"}&amp;gt;} Visitors)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 02:01:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714365#M476051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-20T02:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sum data if a month</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714366#M476052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer Bruno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tested it. But it doesn't work. I don't why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my statement, I'm working with week data. So my statement is&lt;/P&gt;&lt;P&gt;Sum( {1&amp;lt; date = {"&amp;gt;=$(=WeekStart(date))"} &amp;gt;} , Visitor)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, I don't understand the second part of your statement &lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Date = {"&amp;gt;=$(=MonthStart(Max(Date)))&lt;STRONG&gt;&amp;lt;=$(=Max(Date))&lt;/STRONG&gt;"}&amp;gt;} Visitors)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 09:15:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714366#M476052</guid>
      <dc:creator />
      <dc:date>2014-06-20T09:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sum data if a month</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714367#M476053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am assuming that Visitor as Visitor_No (unique entry)&lt;/P&gt;&lt;P&gt;As you are counting the no.of visitiors,&amp;nbsp; need to use the function Count()&amp;nbsp; instead of Sum()...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 09:49:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714367#M476053</guid>
      <dc:creator>PradeepReddy</dc:creator>
      <dc:date>2014-06-20T09:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sum data if a month</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714368#M476054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check the PFA may be it will fulfill your requirement.. !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 09:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714368#M476054</guid>
      <dc:creator />
      <dc:date>2014-06-20T09:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum data if a month</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714369#M476055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just notice something in the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's imagine that there are many date in the Date Dimension, date from 2013/01/01 to 2020/12/31 and you have sales from 2013/04/01 to today. How do you write your SA statement knowing date if you just write MAX(date) you are referencing 2020/12/31 and not today ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 11:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714369#M476055</guid>
      <dc:creator />
      <dc:date>2014-06-20T11:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Sum data if a month</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714370#M476056</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;There is an extra comma in your expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Sum( {1&amp;lt; date = {"&amp;gt;=$(=WeekStart(date))"} &amp;gt;} &lt;STRONG style="color: #ff0000;"&gt;,&lt;/STRONG&gt; Visitor)&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;You should remove it. And you used the field date directly inside the function WeekStart. It will only work if the user has select exactly one date.&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;About the second part of the expression, when you use a "" search in set analysis you can specify more than one condition. For example&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;Sum({1&amp;lt;Year = {"&amp;gt;=2010&amp;lt;=2013"} Sales)&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;would return the Sum of all Sales from 2010 to 2013.&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;So, the second part o of the expression, since I used the {$} set, limit the upper bound to the max date selected. That way, the user could select a time period and see the number of visitors of the associated month (or week).&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;Please, take heed of Pradeep's comment and make sure of which expression we need: Sum or Count.&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;Since you seem to want the number of visitors from the most recent week only, regardless of the period selected, and your dates go all the way to 2020, you could try this expression:&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;Sum({1&amp;lt;date = {"&amp;gt;$(=WeekStart(Today()))"}&amp;gt;} Visitor)&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;You'll have the the sum of the number of visitors from the beginning of this week until today. &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;Regards.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 13:27:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-data-if-a-month/m-p/714370#M476056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-20T13:27:27Z</dc:date>
    </item>
  </channel>
</rss>

