<?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 Obtain Total for the Following Year in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555430#M110760</link>
    <description>&lt;P class=""&gt;&lt;SPAN&gt;Hello !!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;I have a requirement that I hope you can help me with.&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;What I want to achieve is to &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;carry over the final total from 2025&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; in an &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;Income and Expenses&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; table, so that this total is reflected in the &lt;STRONG&gt;STA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;line when selecting &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;2026&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;Ideally, this should work &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;automatically for future years&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; as well. For example, when 2027 becomes the new year, the final total from 2026 should automatically be carried over to the STA line for 2027.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;What I have achieved so far is to carry over the &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;2025 final total to the STA line&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;. However, when I move to 2026, the value changes, whereas I need the value to &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;remain fixed based on the previous year's final total&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;I have attached my current formula, which achieves the first part of the requirement, along with the variables and an Excel file for better understanding of the expected behavior.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;af_estado_cuenta_item = 'Egresos'&lt;BR /&gt;and af_estado_cuenta_concepto = 'Saldo temporada anterior',&lt;/P&gt;&lt;P&gt;Sum(Total&lt;BR /&gt;Aggr(&lt;BR /&gt;(&lt;BR /&gt;If(&lt;BR /&gt;af_estado_cuenta_item = 'Ingresos'&lt;BR /&gt;and af_estado_cuenta_descripcion_estado_ingresos &amp;lt;&amp;gt; 'R',&lt;/P&gt;&lt;P&gt;Pick(&lt;BR /&gt;Match(&lt;BR /&gt;af_estado_cuenta_concepto,&lt;BR /&gt;'Ingreso Cerezas',&lt;BR /&gt;'Ingreso Ciruelas',&lt;BR /&gt;'Ingreso Kiwis',&lt;BR /&gt;'Ingreso Manzanas'&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;af_especie={'Cerezas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Cerezas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;af_especie={'Ciruelas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Ciruelas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;af_especie={'Kiwis'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Kiwis'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;af_temporada={2025}&amp;gt;}&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;af_especie={'Manzanas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Manzanas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Ppto',&lt;BR /&gt;Sum(af_estado_cuenta_rnp_ppto_monto),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Real Acum Ppto',&lt;BR /&gt;Sum(af_estado_cuenta_rnp_rap_monto),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Prom',&lt;BR /&gt;Sum(af_estado_cuenta_valor_total_ingreso_real)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;af_estado_cuenta_item,&lt;BR /&gt;af_estado_cuenta_concepto&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Variables:&lt;BR /&gt;$(v_cajasdn) = sum(if(af_estado_analisis_financiero_produccion = 'P',af_cajas_vigente_real,af_cajas_produccion_real))&lt;BR /&gt;$(v_rnp_Ingresos_I) = Avg(resultado_neto_productor_unitario_caja_NRNP)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Aug 2026 13:45:41 GMT</pubDate>
    <dc:creator>pgalvezt2021</dc:creator>
    <dc:date>2026-08-28T13:45:41Z</dc:date>
    <item>
      <title>Obtain Total for the Following Year</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555430#M110760</link>
      <description>&lt;P class=""&gt;&lt;SPAN&gt;Hello !!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;I have a requirement that I hope you can help me with.&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;What I want to achieve is to &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;carry over the final total from 2025&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; in an &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;Income and Expenses&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; table, so that this total is reflected in the &lt;STRONG&gt;STA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;line when selecting &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;2026&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;Ideally, this should work &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;automatically for future years&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; as well. For example, when 2027 becomes the new year, the final total from 2026 should automatically be carried over to the STA line for 2027.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;What I have achieved so far is to carry over the &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;2025 final total to the STA line&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;. However, when I move to 2026, the value changes, whereas I need the value to &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;remain fixed based on the previous year's final total&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;I have attached my current formula, which achieves the first part of the requirement, along with the variables and an Excel file for better understanding of the expected behavior.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;af_estado_cuenta_item = 'Egresos'&lt;BR /&gt;and af_estado_cuenta_concepto = 'Saldo temporada anterior',&lt;/P&gt;&lt;P&gt;Sum(Total&lt;BR /&gt;Aggr(&lt;BR /&gt;(&lt;BR /&gt;If(&lt;BR /&gt;af_estado_cuenta_item = 'Ingresos'&lt;BR /&gt;and af_estado_cuenta_descripcion_estado_ingresos &amp;lt;&amp;gt; 'R',&lt;/P&gt;&lt;P&gt;Pick(&lt;BR /&gt;Match(&lt;BR /&gt;af_estado_cuenta_concepto,&lt;BR /&gt;'Ingreso Cerezas',&lt;BR /&gt;'Ingreso Ciruelas',&lt;BR /&gt;'Ingreso Kiwis',&lt;BR /&gt;'Ingreso Manzanas'&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;af_especie={'Cerezas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Cerezas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;af_especie={'Ciruelas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Ciruelas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;af_especie={'Kiwis'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Kiwis'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;af_temporada={2025}&amp;gt;}&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;af_especie={'Manzanas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Manzanas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Ppto',&lt;BR /&gt;Sum(af_estado_cuenta_rnp_ppto_monto),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Real Acum Ppto',&lt;BR /&gt;Sum(af_estado_cuenta_rnp_rap_monto),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Prom',&lt;BR /&gt;Sum(af_estado_cuenta_valor_total_ingreso_real)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;af_estado_cuenta_item,&lt;BR /&gt;af_estado_cuenta_concepto&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Variables:&lt;BR /&gt;$(v_cajasdn) = sum(if(af_estado_analisis_financiero_produccion = 'P',af_cajas_vigente_real,af_cajas_produccion_real))&lt;BR /&gt;$(v_rnp_Ingresos_I) = Avg(resultado_neto_productor_unitario_caja_NRNP)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2026 13:45:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555430#M110760</guid>
      <dc:creator>pgalvezt2021</dc:creator>
      <dc:date>2026-08-28T13:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Total for the Following Year</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555434#M110763</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Use the previous selected year in the set analysis instead of fixing 2025.&lt;/P&gt;&lt;P&gt;Sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt;af_temporada={"=$(=Max(af_temporada)-1)"}&amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; TOTAL Aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; YourExpression,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; af_estado_cuenta_item,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; af_estado_cuenta_concepto&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;For the STA line, replace the hardcoded:&lt;/P&gt;&lt;P&gt;af_temporada={2025}&lt;/P&gt;&lt;P&gt;With&lt;/P&gt;&lt;P&gt;af_temporada={"=$(=Only(af_temporada)-1)"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2026 14:56:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555434#M110763</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2026-08-28T14:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Total for the Following Year</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555439#M110764</link>
      <description>&lt;P&gt;Hello Thank you for your reply !!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;I have implemented the changes you suggested, but QlikView is still showing the 2026 Current Account Balance instead of the 2025 balance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;The balance shown when I select 2026 is the balance calculated from the script. The idea is to &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;replace that value with the final total calculated when 2025 is selected&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In other words, the 2025 value should be &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;frozen and carried over to 2026 specifically for that line&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the script:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sum(&lt;/P&gt;&lt;P&gt;{&amp;lt;af_temporada={"=$(=Max(af_temporada)-1)"}&amp;gt;}&lt;/P&gt;&lt;P&gt;TOTAL Aggr(&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;af_estado_cuenta_item = 'Egresos'&lt;BR /&gt;and af_estado_cuenta_concepto = 'Saldo temporada anterior',&lt;/P&gt;&lt;P&gt;Sum(Total&lt;BR /&gt;Aggr(&lt;BR /&gt;(&lt;BR /&gt;If(&lt;BR /&gt;af_estado_cuenta_item = 'Ingresos'&lt;BR /&gt;and af_estado_cuenta_descripcion_estado_ingresos &amp;lt;&amp;gt; 'R',&lt;/P&gt;&lt;P&gt;Pick(&lt;BR /&gt;Match(&lt;BR /&gt;af_estado_cuenta_concepto,&lt;BR /&gt;'Ingreso Cerezas',&lt;BR /&gt;'Ingreso Ciruelas',&lt;BR /&gt;'Ingreso Kiwis',&lt;BR /&gt;'Ingreso Manzanas'&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;af_temporada={"=$(=Only(af_temporada)-1)"},&lt;BR /&gt;af_especie={'Cerezas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Cerezas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;af_temporada={"=$(=Only(af_temporada)-1)"},&lt;BR /&gt;af_especie={'Ciruelas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Ciruelas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;af_temporada={"=$(=Only(af_temporada)-1)"},&lt;BR /&gt;af_especie={'Kiwis'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Kiwis'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;af_temporada={"=$(=Only(af_temporada)-1)"},&lt;BR /&gt;af_especie={'Manzanas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Manzanas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Ppto',&lt;BR /&gt;Sum({&amp;lt;af_temporada={"=$(=Only(af_temporada)-1)"}&amp;gt;}af_estado_cuenta_rnp_ppto_monto),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Real Acum Ppto',&lt;BR /&gt;Sum({&amp;lt;af_temporada={"=$(=Only(af_temporada)-1)"}&amp;gt;}af_estado_cuenta_rnp_rap_monto),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Prom',&lt;BR /&gt;Sum({&amp;lt;af_temporada={"=$(=Only(af_temporada)-1)"}&amp;gt;}af_estado_cuenta_valor_total_ingreso_real)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;af_estado_cuenta_item,&lt;BR /&gt;af_estado_cuenta_concepto&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;)&lt;BR /&gt;,&lt;/P&gt;&lt;P&gt;af_estado_cuenta_item,&lt;/P&gt;&lt;P&gt;af_estado_cuenta_concepto&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2026 15:53:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555439#M110764</guid>
      <dc:creator>pgalvezt2021</dc:creator>
      <dc:date>2026-08-28T15:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Total for the Following Year</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555464#M110766</link>
      <description>&lt;DIV class="ds-virtual-list-items _6f2c522"&gt;
&lt;DIV class="ds-virtual-list-visible-items"&gt;
&lt;DIV class="_9663006" data-virtual-list-item-key="-26"&gt;
&lt;DIV class="d29f3d7d ds-message _63c77b1"&gt;
&lt;DIV class="fbb737a4"&gt;
&lt;DIV class="ds-collapsible-text"&gt;
&lt;DIV&gt;&lt;SPAN&gt;short it&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="_11d6b3a"&gt;
&lt;DIV class="_425ea0b"&gt;
&lt;DIV class="ds-flex _78e0558 _0bbda35"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="_4f9bf79 d7dc56a8 _43c05b5" data-virtual-list-item-key="48"&gt;
&lt;DIV class="ds-message _63c77b1"&gt;
&lt;DIV class="ds-markdown ds-assistant-message-main-content"&gt;
&lt;P class="ds-markdown-paragraph"&gt;&lt;SPAN class=""&gt;Hey,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="ds-markdown-paragraph"&gt;&lt;SPAN class=""&gt;Your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE&gt;Only(af_temporada)-1&lt;/CODE&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is dynamic — it recalculates when you select 2026 instead of freezing the 2025 total.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="ds-markdown-paragraph"&gt;&lt;SPAN class=""&gt;Try this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="ds-markdown-paragraph"&gt;&lt;SPAN class=""&gt;Replace:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="md-code-block md-code-block-light"&gt;
&lt;DIV class="md-code-block-banner-wrap"&gt;
&lt;DIV class="md-code-block-banner md-code-block-banner-lite"&gt;
&lt;DIV class="_121d384"&gt;
&lt;DIV class="d2a24f03"&gt;&lt;SPAN class="d813de27"&gt;text&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;{&amp;lt;af_temporada={"=$(=Only(af_temporada)-1)"}&amp;gt;}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P class="ds-markdown-paragraph"&gt;&lt;SPAN class=""&gt;With:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="md-code-block md-code-block-light"&gt;
&lt;DIV class="md-code-block-banner-wrap"&gt;
&lt;DIV class="md-code-block-banner md-code-block-banner-lite"&gt;
&lt;DIV class="_121d384"&gt;
&lt;DIV class="d2a24f03"&gt;&lt;SPAN class="d813de27"&gt;text&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;{&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"}&amp;gt;}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P class="ds-markdown-paragraph"&gt;&lt;SPAN class=""&gt;This forces it to always look at the max available year minus 1, not the current selection.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="ds-markdown-paragraph"&gt;&lt;SPAN class=""&gt;If that still doesn't work, you'll need to pre-calculate the prior year's closing balance in the load script and store it as a fixed value. Pull that instead of recalculating on the fly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="ds-flex _0a3d93b"&gt;
&lt;DIV class="ds-flex _965abe9 _54866f7"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 30 Aug 2026 05:55:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555464#M110766</guid>
      <dc:creator>Stefan764</dc:creator>
      <dc:date>2026-08-30T05:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Total for the Following Year</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555525#M110772</link>
      <description>&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;Thank you for your reply....&lt;/P&gt;&lt;DIV&gt;The value is still changing; I haven't found a way to keep it fixed. I'll share the formula as well so you can verify whether I implemented it correctly.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;=Sum(&lt;/P&gt;&lt;P&gt;{&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"}&amp;gt;}&lt;/P&gt;&lt;P&gt;TOTAL Aggr(&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;af_estado_cuenta_item = 'Egresos'&lt;BR /&gt;and af_estado_cuenta_concepto = 'Saldo temporada anterior',&lt;/P&gt;&lt;P&gt;Sum(Total&lt;BR /&gt;Aggr(&lt;BR /&gt;(&lt;BR /&gt;If(&lt;BR /&gt;af_estado_cuenta_item = 'Ingresos'&lt;BR /&gt;and af_estado_cuenta_descripcion_estado_ingresos &amp;lt;&amp;gt; 'R',&lt;/P&gt;&lt;P&gt;Pick(&lt;BR /&gt;Match(&lt;BR /&gt;af_estado_cuenta_concepto,&lt;BR /&gt;'Ingreso Cerezas',&lt;BR /&gt;'Ingreso Ciruelas',&lt;BR /&gt;'Ingreso Kiwis',&lt;BR /&gt;'Ingreso Manzanas'&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"},&lt;BR /&gt;af_especie={'Cerezas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Cerezas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"},&lt;BR /&gt;af_especie={'Ciruelas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Ciruelas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum(&lt;BR /&gt;{&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"},&lt;BR /&gt;af_especie={'Kiwis'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Kiwis'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"},&lt;BR /&gt;af_especie={'Manzanas'},&lt;BR /&gt;af_estado_cuenta_concepto={'Ingreso Manzanas'}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;)&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Ppto',&lt;BR /&gt;Sum({&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"}&amp;gt;}af_estado_cuenta_rnp_ppto_monto),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Real Acum Ppto',&lt;BR /&gt;Sum({&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"}&amp;gt;}af_estado_cuenta_rnp_rap_monto),&lt;/P&gt;&lt;P&gt;If(&lt;BR /&gt;GetFieldSelections(rnp_tipo) = 'RNP Prom',&lt;BR /&gt;Sum({&amp;lt;af_temporada={"=$(=Max(TOTAL af_temporada)-1)"}&amp;gt;}af_estado_cuenta_valor_total_ingreso_real)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;af_estado_cuenta_item,&lt;BR /&gt;af_estado_cuenta_concepto&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;)&lt;BR /&gt;,&lt;/P&gt;&lt;P&gt;af_estado_cuenta_item,&lt;/P&gt;&lt;P&gt;af_estado_cuenta_concepto&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 Aug 2026 13:50:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555525#M110772</guid>
      <dc:creator>pgalvezt2021</dc:creator>
      <dc:date>2026-08-31T13:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Total for the Following Year</title>
      <link>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555561#M110775</link>
      <description>&lt;P&gt;I suggest to reduce the complexity to focus on the issue - respecting unexpected on period-selections. This means removing all other conditions especially the nested if-loops and the pick(match()) branching.&lt;/P&gt;&lt;P&gt;It remains something like:&lt;/P&gt;&lt;P&gt;sum(aggr(sum(aggr(sum(aggr(sum/avg()))))))&lt;/P&gt;&lt;P&gt;Each of the parts may need the relevant set analysis condition respectively may look like:&lt;/P&gt;&lt;P&gt;sum({ SET } aggr({ SET } sum({ SET } aggr({ SET } sum({ SET } aggr({ SET } sum/avg({ SET } ))))))&lt;/P&gt;&lt;P&gt;Are there embedded aggregations within the set analysis they may also need an extra { SET }.&lt;/P&gt;&lt;P&gt;In my experience it's quite hard to develop such approach as a complete measure. Much simpler will be to use a table-chart and adding there all single parts in parallel measures and then combining them step by step.&lt;/P&gt;&lt;P&gt;Beside of the above such approach of nested aggr() requires a lot of resources and by a bit larger data-sets it will be probably quite slow. Therefore I would try to simplify everything possible, for example transferring the pick(match()) directly within the sum(), like:&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;Sum(&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;&lt;STRIKE&gt;af_especie={'Cerezas'},&lt;/STRIKE&gt;&lt;BR /&gt;af_estado_cuenta_concepto={&lt;STRONG&gt;'$(=maxstring(af_estado_cuenta_concepto))'&lt;/STRONG&gt;}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Aggr($(v_cajasdn) * $(v_rnp_Ingresos_I), af_variedad)&lt;BR /&gt;)&lt;BR /&gt;...&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2026 09:44:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Obtain-Total-for-the-Following-Year/m-p/2555561#M110775</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-09-01T09:44:01Z</dc:date>
    </item>
  </channel>
</rss>

