<?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: Year quarters with volumes (Sum the volumes) in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Year-quarters-with-volumes-Sum-the-volumes/m-p/1121641#M19400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This one worked for me:&lt;/P&gt;&lt;P&gt;To get the total correct AND the correct volume numbers, based on quarters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current Quarter:&lt;/P&gt;&lt;P&gt;Sum(if (inQuarter(reportingdate, QuarterStart(Today()), 0), Volume))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous Quarter:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sum(if (inQuarter(reportingdate, QuarterStart(Today()), -1), Volume))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;etc..&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Aug 2016 14:28:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-31T14:28:34Z</dc:date>
    <item>
      <title>Year quarters with volumes (Sum the volumes)</title>
      <link>https://community.qlik.com/t5/App-Development/Year-quarters-with-volumes-Sum-the-volumes/m-p/1121640#M19399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a beginner with qlik scripting. I have data loaded that comes from our postgres db.&lt;/P&gt;&lt;P&gt;I have the following fields.&lt;/P&gt;&lt;P&gt;name = string&lt;/P&gt;&lt;P&gt;volume = integer&lt;/P&gt;&lt;P&gt;reportingmonth = epoch miliseconds (e.g. &lt;SPAN style="color: #000000; font-family: 'Open Sans', 'Lucida Grande', sans-serif; font-size: 14px;"&gt;1472629930000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is how I convert the reportingmonth to a qlik date: Date(MakeDate(1970, 1, 1) + round("reportingmonth"/1000) / (60 * 60 * 24)) as "reportingdate"&lt;/P&gt;&lt;P&gt;See the attachment for my test data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want a table in my qlik sense app that looks like this:&lt;/P&gt;&lt;P&gt;name, Current Quarter, Previous Quarter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&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; , 17&lt;/P&gt;&lt;P&gt;Test1, 10&lt;/P&gt;&lt;P&gt;Test2,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; , 12&lt;/P&gt;&lt;P&gt;Test3, 5&lt;/P&gt;&lt;P&gt;Test4,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; , 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say the current quarter is equal to Q3 2016, all the volumes with an epoch timestamp, that fall in Q3, should fall in the "Current Quarter" column. Previous Quarter is equal to Q2 2016 and all the volumes with an epoch timestamp, that fall in Q2 should fall in the column "Previous Quarter".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know you can use this function: &lt;SPAN style="color: #0f0f0f; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px;"&gt;inquarter ('25/01/2013', '01/01/2013', 0)&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;, but how to use it in conjuction with my volume column or is there even a better solution?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;--edit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;I tried this: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Sum({$&amp;lt;inQuarter(reportingdate, now(), 0)&amp;gt;}Volume), but I get an error: Error in set modifier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;Sum({$&amp;lt;inQuarter(reportingdate, '08/31/2016', 0)&amp;gt;}Volume), but I get an error: Error in set modifier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;I tried an if, I got something, but not totally:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;&lt;IMG __jive_id="136148" alt="inquarters.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/136148_inquarters.PNG" style="height: 143px; width: 620px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;I used this: if (inQuarter(reportingdate, '01/01/2016', 0), Sum(Volume)), but as you can see, I need to hardcode my base_date as a string, I don't want that, I want to use the now() function. But then I don't get any results... &lt;/SPAN&gt;&lt;SPAN style="color: #0f0f0f; font-size: 13.3333px; line-height: 1.5em;"&gt;Also the total shows only for the first one, I want it for all, directly on load, is that possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 11:55:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Year-quarters-with-volumes-Sum-the-volumes/m-p/1121640#M19399</guid>
      <dc:creator />
      <dc:date>2016-08-31T11:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Year quarters with volumes (Sum the volumes)</title>
      <link>https://community.qlik.com/t5/App-Development/Year-quarters-with-volumes-Sum-the-volumes/m-p/1121641#M19400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This one worked for me:&lt;/P&gt;&lt;P&gt;To get the total correct AND the correct volume numbers, based on quarters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current Quarter:&lt;/P&gt;&lt;P&gt;Sum(if (inQuarter(reportingdate, QuarterStart(Today()), 0), Volume))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous Quarter:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sum(if (inQuarter(reportingdate, QuarterStart(Today()), -1), Volume))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;etc..&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Year-quarters-with-volumes-Sum-the-volumes/m-p/1121641#M19400</guid>
      <dc:creator />
      <dc:date>2016-08-31T14:28:34Z</dc:date>
    </item>
  </channel>
</rss>

