<?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 Totalize rollforward measure in pivot table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Totalize-rollforward-measure-in-pivot-table/m-p/1739288#M56538</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I've been trying to totalize two specific measures in a pivot table, one of them involving a rangemax and the other involving an if. As expected, the calculated total is the formula of the measure applied to the total of the other measures.&lt;/P&gt;&lt;P&gt;I am aware that the way to achieve this is to use Aggr function over the dimensions, but this don't seem to work as my not totalized measures rely on results from the other measures, which depend on the results of the previous period (end of period final measure result is beggining of period first measure result).&lt;/P&gt;&lt;P&gt;Formulas are:&lt;/P&gt;&lt;P&gt;InvIni =&amp;nbsp;If(AñoMes = $(sAñoMes), $(vInv), Before([InvFin]))&lt;/P&gt;&lt;P&gt;Fcst =&amp;nbsp;Sum(Cantidad)&lt;/P&gt;&lt;P&gt;PrdIdl =&amp;nbsp;RangeMax($(cDeseable) * $(vFcstPrm) - [InvIni] + [Fcst], 0)&lt;/P&gt;&lt;P&gt;Ajuste =&amp;nbsp;If([PrdIdl], Ceil(RangeMax([PrdIdl], Sum(MinimoPrd)) / Sum(CapCaja)) * Sum(CapCaja) - [PrdIdl], 0)&lt;/P&gt;&lt;P&gt;InvFin =&amp;nbsp;[InvIni] + [PrdIdl] + [Ajuste] - [Fcst]&lt;/P&gt;&lt;P&gt;sAñoMes and&amp;nbsp;cDeseable are constants&lt;/P&gt;&lt;P&gt;vFcstPrm is a weighted average of Sum(Cantidad) by AñoMes&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="agustapia_1-1598558746471.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/39695iDC435764D541BF71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="agustapia_1-1598558746471.png" alt="agustapia_1-1598558746471.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Attached you can find a sample of the problem I have.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 01:34:33 GMT</pubDate>
    <dc:creator>agustapia</dc:creator>
    <dc:date>2024-11-16T01:34:33Z</dc:date>
    <item>
      <title>Totalize rollforward measure in pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Totalize-rollforward-measure-in-pivot-table/m-p/1739288#M56538</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I've been trying to totalize two specific measures in a pivot table, one of them involving a rangemax and the other involving an if. As expected, the calculated total is the formula of the measure applied to the total of the other measures.&lt;/P&gt;&lt;P&gt;I am aware that the way to achieve this is to use Aggr function over the dimensions, but this don't seem to work as my not totalized measures rely on results from the other measures, which depend on the results of the previous period (end of period final measure result is beggining of period first measure result).&lt;/P&gt;&lt;P&gt;Formulas are:&lt;/P&gt;&lt;P&gt;InvIni =&amp;nbsp;If(AñoMes = $(sAñoMes), $(vInv), Before([InvFin]))&lt;/P&gt;&lt;P&gt;Fcst =&amp;nbsp;Sum(Cantidad)&lt;/P&gt;&lt;P&gt;PrdIdl =&amp;nbsp;RangeMax($(cDeseable) * $(vFcstPrm) - [InvIni] + [Fcst], 0)&lt;/P&gt;&lt;P&gt;Ajuste =&amp;nbsp;If([PrdIdl], Ceil(RangeMax([PrdIdl], Sum(MinimoPrd)) / Sum(CapCaja)) * Sum(CapCaja) - [PrdIdl], 0)&lt;/P&gt;&lt;P&gt;InvFin =&amp;nbsp;[InvIni] + [PrdIdl] + [Ajuste] - [Fcst]&lt;/P&gt;&lt;P&gt;sAñoMes and&amp;nbsp;cDeseable are constants&lt;/P&gt;&lt;P&gt;vFcstPrm is a weighted average of Sum(Cantidad) by AñoMes&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="agustapia_1-1598558746471.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/39695iDC435764D541BF71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="agustapia_1-1598558746471.png" alt="agustapia_1-1598558746471.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Attached you can find a sample of the problem I have.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Totalize-rollforward-measure-in-pivot-table/m-p/1739288#M56538</guid>
      <dc:creator>agustapia</dc:creator>
      <dc:date>2024-11-16T01:34:33Z</dc:date>
    </item>
  </channel>
</rss>

