<?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: Help: Expression to sum values on max date for a month or period in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-Expression-to-sum-values-on-max-date-for-a-month-or-period/m-p/128131#M604342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;‌, sorry, english ain't my native language so it's harder to express myself the right way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the first picture, my biggest problem is how to build a unique expression to show the result of "test2" and "test" on a single column. Adding both columns is not a good solution because, when I deselect the business week, I get the same value for "test" and "test2" (none of them gets a 0) and the sum ends up representing 2 times the real stock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is a expression that does the following on a single column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - If the period 22nd to 26th of January is selected, only sum the stock of the 26th of January.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - If the period of 29th of January to the 4th of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Febraury is selected, do the sum of stock from the 31th of January (last day of the month) and the sum of stock for the 4th of Febraury (last day of the selected period).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - If a day is selected, show the sum of stock for that day.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - If there is no selection made, show the sum of stock for the last day of each month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&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; font-size: 13px;"&gt;From the second picture and some analysis, I realized that the expression "test2" is better than "test", as "test2" works ok indistinctly of the year, but "test" doesn't give the right results for 2018. I checked every value against the original data provided by the B2b companies.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I express my problem better this time, thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jul 2018 15:10:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-07-11T15:10:06Z</dc:date>
    <item>
      <title>Help: Expression to sum values on max date for a month or period</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Expression-to-sum-values-on-max-date-for-a-month-or-period/m-p/128129#M604338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hello.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I'm having problems with a dynamic table expression, where I want to show the stock for the last recorded day of the month or period. The stock values are given by product per day, so I need to sum only the stock per product for the last recorded day.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Currently I am doing some testing with the following results:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Given:&lt;SPAN style="font-family: inherit; font-style: inherit;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: inherit; font-style: inherit;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PeriodID = (Year*12)+Month&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date = DD-MM-YYYY&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;test2:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(month = max(month),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;PeriodID = {"&amp;lt;=$(=Max(PeriodID))"}, year =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {"$(=Max(year))"}, month =, day =, FECHA_DATOS =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {"=Day(FECHA_DATOS) = Day(MonthEnd(FECHA_DATOS))"} &amp;gt; } [stock])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Day(FECHA_DATOS) = Day(MonthEnd(FECHA_DATOS)),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;PeriodID = {"&amp;lt;=$(=Max(PeriodID))"}, year ={"$(=Max(year))"}, month = {"$(=Max(month))"},&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FECHA_DATOS = {"=Day(FECHA_DATOS) = Day($(=Max(FECHA_DATOS)))"} &amp;gt; } [stock]))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;test:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Day(FECHA_DATOS) = Day(MonthEnd(FECHA_DATOS)),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;PeriodID = {"&amp;lt;=$(=Max(PeriodID))"}, year =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {"$(=Max(year))"}, month =, day =, FECHA_DATOS =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {"=Day(FECHA_DATOS) = Day(MonthEnd(FECHA_DATOS))"} &amp;gt; } [stock])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({$&amp;lt;PeriodID = {"&amp;lt;=$(=Max(PeriodID))"}, year ={"$(=Max(year))"}, month =, day =,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FECHA_DATOS = {"=Day(FECHA_DATOS) = Day($(=Max(FECHA_DATOS)))"} &amp;gt; } [stock])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;STOCK Actual:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; test+test2&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If I filter for the 5th comercial week (2017: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;January 30th to Febraury 5th &amp;amp; 2018: &lt;/SPAN&gt;January &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;29th to Febraury 4th) I get the following results:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;IMG __jive_id="207476" alt="Period.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/207476_Period.PNG" style="height: auto; display: block; margin-left: auto; margin-right: auto;" /&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;STOCK Actual is just a way to aggregate test2 and test into a single column (looking to hide them afterwards).&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Then, if I take the week filter, I get the following data by month:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: center;"&gt;&lt;IMG __jive_id="207466" alt="Month.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/207466_Month.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Where there is a evident difference between test2 and test.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;This is why I'm looking for your help, to fix one of the above expressions and end up with a single column that shows the monthly and weekly (business week) stock.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks in advance, best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 16:12:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Expression-to-sum-values-on-max-date-for-a-month-or-period/m-p/128129#M604338</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-10T16:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Expression to sum values on max date for a month or period</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Expression-to-sum-values-on-max-date-for-a-month-or-period/m-p/128130#M604340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not entirely sure I follow... what is right and what is wrong in the above images? With regards to what is wrong, what is the expected output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 18:06:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Expression-to-sum-values-on-max-date-for-a-month-or-period/m-p/128130#M604340</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-07-10T18:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Expression to sum values on max date for a month or period</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Expression-to-sum-values-on-max-date-for-a-month-or-period/m-p/128131#M604342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;‌, sorry, english ain't my native language so it's harder to express myself the right way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the first picture, my biggest problem is how to build a unique expression to show the result of "test2" and "test" on a single column. Adding both columns is not a good solution because, when I deselect the business week, I get the same value for "test" and "test2" (none of them gets a 0) and the sum ends up representing 2 times the real stock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is a expression that does the following on a single column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - If the period 22nd to 26th of January is selected, only sum the stock of the 26th of January.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - If the period of 29th of January to the 4th of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Febraury is selected, do the sum of stock from the 31th of January (last day of the month) and the sum of stock for the 4th of Febraury (last day of the selected period).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - If a day is selected, show the sum of stock for that day.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - If there is no selection made, show the sum of stock for the last day of each month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&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; font-size: 13px;"&gt;From the second picture and some analysis, I realized that the expression "test2" is better than "test", as "test2" works ok indistinctly of the year, but "test" doesn't give the right results for 2018. I checked every value against the original data provided by the B2b companies.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I express my problem better this time, thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:10:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Expression-to-sum-values-on-max-date-for-a-month-or-period/m-p/128131#M604342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-11T15:10:06Z</dc:date>
    </item>
  </channel>
</rss>

