<?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 set filter in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/set-filter/m-p/1899197#M74222</link>
    <description>&lt;P&gt;Hello everyone! Sorry for my English, I'm writing with a translator)&lt;/P&gt;
&lt;P&gt;Please tell me in the next question:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is necessary to calculate the amount of balances by beneficiary_bank_name in the context of "year to previous year".&lt;/P&gt;
&lt;P&gt;This is the formula for the selected year:&lt;/P&gt;
&lt;P&gt;sum(Aggr&amp;nbsp;(Sum(Aggr(&amp;nbsp; If(escrow_balance_date =&amp;nbsp; Max(TOTAL &amp;lt;escrow_agreement_id,escrow_balance_date.autoCalendar.Year&amp;gt; {$&amp;lt;[escrow_balance_date.autoCalendar.Year]={"$(=date(max(escrow_balance_date.autoCalendar.Year),'YYYY'))"}&amp;gt;}escrow_balance_date),&amp;nbsp; &amp;nbsp; &amp;nbsp; escrow_balance_sum),&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;escrow_agreement_id,&amp;nbsp; &amp;nbsp; &amp;nbsp;escrow_balance_date)),&amp;nbsp; &amp;nbsp;beneficiary_bank_name))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//we set the maximum date under the contract (because one contract may have several opening dates)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;//if the date of the contract in the selected year coincides with the maximum date of the contract of this year, then we take the amount of this contract&lt;/P&gt;
&lt;P&gt;//grouping data by agreement id, amount and date of agreement and&amp;nbsp;beneficiary_bank_name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And there is a formula for the previous year:&lt;/P&gt;
&lt;P&gt;=sum(Aggr(Sum(Aggr(&lt;/P&gt;
&lt;P&gt;If(escrow_balance_date =&lt;/P&gt;
&lt;P&gt;Max(&lt;/P&gt;
&lt;P&gt;TOTAL &amp;lt;escrow_agreement_id,escrow_balance_date.autoCalendar.Year&amp;gt;&lt;/P&gt;
&lt;P&gt;{&amp;lt;[escrow_balance_date.autoCalendar.Year]={'$(#vLastYear)'}&amp;gt;}escrow_balance_date),&lt;/P&gt;
&lt;P&gt;escrow_balance_sum),&lt;/P&gt;
&lt;P&gt;escrow_agreement_id,&lt;/P&gt;
&lt;P&gt;escrow_balance_date)),&lt;/P&gt;
&lt;P&gt;beneficiary_bank_name))&lt;/P&gt;
&lt;P&gt;// where vLastYear= date(AddYears(max(escrow_balance_date.autoCalendar.Year),-1),'YYYY')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When we do not select anything in the filter, the data is output correctly:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 745px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73357iE64BBD0C1D463EC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, when we select 2021 in the filter, for example, to compare with 20, the previous year will be empty, due to the fact that filtering by escrow_balance_date and 20 year does not fall.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 889px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73359iE478C29DC64651A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;how can this filtering be avoided so that all the dates for comparison are included. We tried to do it through Resident Load to add a table with dates, and through variables in the table, but this also does not work correctly.&lt;/P&gt;
&lt;P&gt;I attach a file with the report. Thank you all in advance&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 10:01:27 GMT</pubDate>
    <dc:creator>Tanya_In</dc:creator>
    <dc:date>2022-03-02T10:01:27Z</dc:date>
    <item>
      <title>set filter</title>
      <link>https://community.qlik.com/t5/App-Development/set-filter/m-p/1899197#M74222</link>
      <description>&lt;P&gt;Hello everyone! Sorry for my English, I'm writing with a translator)&lt;/P&gt;
&lt;P&gt;Please tell me in the next question:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is necessary to calculate the amount of balances by beneficiary_bank_name in the context of "year to previous year".&lt;/P&gt;
&lt;P&gt;This is the formula for the selected year:&lt;/P&gt;
&lt;P&gt;sum(Aggr&amp;nbsp;(Sum(Aggr(&amp;nbsp; If(escrow_balance_date =&amp;nbsp; Max(TOTAL &amp;lt;escrow_agreement_id,escrow_balance_date.autoCalendar.Year&amp;gt; {$&amp;lt;[escrow_balance_date.autoCalendar.Year]={"$(=date(max(escrow_balance_date.autoCalendar.Year),'YYYY'))"}&amp;gt;}escrow_balance_date),&amp;nbsp; &amp;nbsp; &amp;nbsp; escrow_balance_sum),&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;escrow_agreement_id,&amp;nbsp; &amp;nbsp; &amp;nbsp;escrow_balance_date)),&amp;nbsp; &amp;nbsp;beneficiary_bank_name))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//we set the maximum date under the contract (because one contract may have several opening dates)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;//if the date of the contract in the selected year coincides with the maximum date of the contract of this year, then we take the amount of this contract&lt;/P&gt;
&lt;P&gt;//grouping data by agreement id, amount and date of agreement and&amp;nbsp;beneficiary_bank_name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And there is a formula for the previous year:&lt;/P&gt;
&lt;P&gt;=sum(Aggr(Sum(Aggr(&lt;/P&gt;
&lt;P&gt;If(escrow_balance_date =&lt;/P&gt;
&lt;P&gt;Max(&lt;/P&gt;
&lt;P&gt;TOTAL &amp;lt;escrow_agreement_id,escrow_balance_date.autoCalendar.Year&amp;gt;&lt;/P&gt;
&lt;P&gt;{&amp;lt;[escrow_balance_date.autoCalendar.Year]={'$(#vLastYear)'}&amp;gt;}escrow_balance_date),&lt;/P&gt;
&lt;P&gt;escrow_balance_sum),&lt;/P&gt;
&lt;P&gt;escrow_agreement_id,&lt;/P&gt;
&lt;P&gt;escrow_balance_date)),&lt;/P&gt;
&lt;P&gt;beneficiary_bank_name))&lt;/P&gt;
&lt;P&gt;// where vLastYear= date(AddYears(max(escrow_balance_date.autoCalendar.Year),-1),'YYYY')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When we do not select anything in the filter, the data is output correctly:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 745px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73357iE64BBD0C1D463EC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, when we select 2021 in the filter, for example, to compare with 20, the previous year will be empty, due to the fact that filtering by escrow_balance_date and 20 year does not fall.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 889px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73359iE478C29DC64651A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;how can this filtering be avoided so that all the dates for comparison are included. We tried to do it through Resident Load to add a table with dates, and through variables in the table, but this also does not work correctly.&lt;/P&gt;
&lt;P&gt;I attach a file with the report. Thank you all in advance&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 10:01:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-filter/m-p/1899197#M74222</guid>
      <dc:creator>Tanya_In</dc:creator>
      <dc:date>2022-03-02T10:01:27Z</dc:date>
    </item>
  </channel>
</rss>

