<?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 expression where a date column matches a date variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974703#M80400</link>
    <description>&lt;P&gt;Have a look at e.g. this thread for examples of using an expression in the set analysis comparison.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Using-an-expression-within-Set-Analysis/m-p/910261" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/Using-an-expression-within-Set-Analysis/m-p/910261&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Aug 2022 09:33:13 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2022-08-30T09:33:13Z</dc:date>
    <item>
      <title>Sum expression where a date column matches a date variable</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974253#M80358</link>
      <description>&lt;P&gt;I created a variable&amp;nbsp;&lt;EM&gt;vLatestDate &lt;/EM&gt;which is derived from the max month of the [date] column&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Denzyl_0-1661777856696.png" style="width: 161px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/87725i0B272B67457AF697/image-dimensions/161x149?v=v2" width="161" height="149" role="button" title="Denzyl_0-1661777856696.png" alt="Denzyl_0-1661777856696.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;vLatestDate:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Max([date])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;I am now trying to create a column that is a sum expression based on the [date] column matching the &lt;EM&gt;vLatestDate&lt;/EM&gt; variable.&lt;/P&gt;
&lt;P&gt;I have tried the follow, but it did not work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[date]=vLatestDate&amp;gt;} [amount])&lt;/LI-CODE&gt;
&lt;P&gt;However, the following code does:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM(IF([date]=vLatestDate, [amount])&lt;/LI-CODE&gt;
&lt;P&gt;Why does the first code not work while the second does?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 13:02:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974253#M80358</guid>
      <dc:creator>Denzyl</dc:creator>
      <dc:date>2022-08-29T13:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sum expression where a date column matches a date variable</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974270#M80361</link>
      <description>&lt;P&gt;You seem to have left out the $() required to parse the variable. &lt;/P&gt;
&lt;P&gt;Try instead:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[date]=$(vLatestDate)&amp;gt;} [amount])&lt;/LI-CODE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[date]= {'$(vLatestDate)'} &amp;gt;} [amount])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 13:45:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974270#M80361</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-08-29T13:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sum expression where a date column matches a date variable</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974498#M80385</link>
      <description>&lt;P&gt;The following code worked:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[date]= {'$(vLatestDate)'}&amp;gt;} [amount])&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 30 Aug 2022 02:11:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974498#M80385</guid>
      <dc:creator>Denzyl</dc:creator>
      <dc:date>2022-08-30T02:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sum expression where a date column matches a date variable</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974590#M80393</link>
      <description>&lt;P&gt;Would it be possible to get the [amount] where [date] = &lt;EM&gt;vLatestDate&lt;/EM&gt; - 1 month?&lt;/P&gt;
&lt;P&gt;I have tried the following codes but it doesn't work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[date]= {'$(addmonths(vLatestDate, -1))'}&amp;gt;} [amount]) 
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;and&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;[date]= {$(addmonths(vLatestDate, -1))}&amp;gt;} [amount]) 
&lt;/LI-CODE&gt;
&lt;P&gt;the expression shows blank values:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Denzyl_0-1661844344523.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/87813iD3A15B27CC3A2930/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Denzyl_0-1661844344523.png" alt="Denzyl_0-1661844344523.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 07:26:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974590#M80393</guid>
      <dc:creator>Denzyl</dc:creator>
      <dc:date>2022-08-30T07:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum expression where a date column matches a date variable</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974703#M80400</link>
      <description>&lt;P&gt;Have a look at e.g. this thread for examples of using an expression in the set analysis comparison.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Using-an-expression-within-Set-Analysis/m-p/910261" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/Using-an-expression-within-Set-Analysis/m-p/910261&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 09:33:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-expression-where-a-date-column-matches-a-date-variable/m-p/1974703#M80400</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-08-30T09:33:13Z</dc:date>
    </item>
  </channel>
</rss>

