<?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 record before date with several selected dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823099#M1213738</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/141904"&gt;@Antoine5531&lt;/a&gt;&amp;nbsp; what do you want to achieve?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jul 2021 14:21:43 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2021-07-19T14:21:43Z</dc:date>
    <item>
      <title>Sum record before date with several selected dates</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823061#M1213735</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm having a hard time to adapt the expression of a pivot table to work with multiple selections.&lt;/P&gt;&lt;P&gt;Here is an image of my table :&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/58802i6BFDF91C38BD4129/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the 'Antérieur' expression (CDELEI = YEAR and MBELE = values to sum) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[CDELEI]={'$(=Max([CDELEI]))'}&amp;gt;}MBELE)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see it only work on the latest year&amp;nbsp;(2017) but not the previous years because of the max function. I'm trying to correct that.&lt;/P&gt;&lt;P&gt;I figured out this expression to return me the year of the column :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SubField(GetFieldSelections(CDELEI, '|'), '|', -ColumnNo(Total))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But combining these two expression dosn't seems possible, I tried many things like :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[CDELEI]={'$(=Max(SubField(GetFieldSelections(CDELEI, CHR(39)|CHR(39)), CHR(39)|CHR(39),-ColumnNo(Total))))'}&amp;gt;}MBELE)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it because of the quotes inside quotes or am i doing it wrong ? (loosing my mind)&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 12:52:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823061#M1213735</guid>
      <dc:creator>Antoine5531</dc:creator>
      <dc:date>2021-07-19T12:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sum record before date with several selected dates</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823072#M1213736</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/141904"&gt;@Antoine5531&lt;/a&gt;&amp;nbsp; try with double quotes&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;[CDELEI]={&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;/FONT&gt;$(=Max(SubField(GetFieldSelections(CDELEI, CHR(39)|CHR(39)), CHR(39)|CHR(39),-ColumnNo(Total))))&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;}&amp;gt;}MBELE)&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 13:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823072#M1213736</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2021-07-19T13:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sum record before date with several selected dates</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823084#M1213737</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I tried your way but only get 0.00€ everywhere.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 13:35:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823084#M1213737</guid>
      <dc:creator>Antoine5531</dc:creator>
      <dc:date>2021-07-19T13:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sum record before date with several selected dates</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823099#M1213738</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/141904"&gt;@Antoine5531&lt;/a&gt;&amp;nbsp; what do you want to achieve?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 14:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823099#M1213738</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2021-07-19T14:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum record before date with several selected dates</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823112#M1213739</link>
      <description>&lt;P&gt;For each selected year, I have a column with the year (CDELEI) being displayed in the table. I would want my expression to return the sum of all the records (MBELE) before that year.&lt;/P&gt;&lt;P&gt;I managed to do it that way :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[CDELEI]={'$(=Max([CDELEI]))'}&amp;gt;}MBELE)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But when multiple years are selected, the expression only work on the latest year and return 0.00 for the other (because of the max). I'm trying to correct that so that I can compare several years in my table.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 14:35:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823112#M1213739</guid>
      <dc:creator>Antoine5531</dc:creator>
      <dc:date>2021-07-19T14:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sum record before date with several selected dates</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823116#M1213741</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/141904"&gt;@Antoine5531&lt;/a&gt;&amp;nbsp; try below expression&lt;/P&gt;&lt;P&gt;=if(getselectedcount([CDELEI])=0,&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;[CDELEI]={'$(=Max([CDELEI]))'}&amp;gt;}MBELE),&lt;/P&gt;&lt;P&gt;SUM(MBELE))&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 14:41:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823116#M1213741</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2021-07-19T14:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sum record before date with several selected dates</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823117#M1213742</link>
      <description>&lt;P&gt;It seems good, I'll check the numbers toomorow.&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 14:48:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-record-before-date-with-several-selected-dates/m-p/1823117#M1213742</guid>
      <dc:creator>Antoine5531</dc:creator>
      <dc:date>2021-07-19T14:48:54Z</dc:date>
    </item>
  </channel>
</rss>

