<?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: Previous year in 2nd dimensionality in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2430999#M96591</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Have you tried using the aggr(&lt;A href="https://thelost.net/" target="_self"&gt;find lost children&lt;/A&gt;) function with the Category field? It might help in replicating the pivot structure for previous years. &lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 20:00:51 GMT</pubDate>
    <dc:creator>jackysins72</dc:creator>
    <dc:date>2024-03-14T20:00:51Z</dc:date>
    <item>
      <title>Previous year in 2nd dimensionality</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2429333#M96425</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I need to replicate this pivot&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mike_spada_0-1710164759839.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161714i3FB9B928237A6AE4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mike_spada_0-1710164759839.png" alt="mike_spada_0-1710164759839.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can calculate previous year amounts for dimensionality()=1, with this formula:&lt;/P&gt;
&lt;P&gt;if(Year= $(vSelectedYear),&lt;BR /&gt;Sum(total {&amp;lt;Year= {"$(=$(vPreviousYear))"}&amp;gt;} Amount)&lt;/P&gt;
&lt;P&gt;and so on.&lt;/P&gt;
&lt;P&gt;repeating for different variables (I can have only 6 years to investigate). That's ok for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I need to do the same with Category field too, that I can see when I expand the pivot, and I cannot.&lt;/P&gt;
&lt;P&gt;I used formulas like these:&lt;/P&gt;
&lt;P&gt;Sum({1&amp;lt;Year = {"$(=$(vPreviousYear))"}&amp;gt;} Amount)&lt;/P&gt;
&lt;P&gt;Sum(aggr(sum({&amp;lt;Year={"$(=$(vPreviousYear))"}&amp;gt;} Amount), Category))&lt;/P&gt;
&lt;P&gt;with no success.&lt;/P&gt;
&lt;P&gt;Can anyone help me please?&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 13:53:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2429333#M96425</guid>
      <dc:creator>mike_spada</dc:creator>
      <dc:date>2024-03-11T13:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Previous year in 2nd dimensionality</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2429374#M96426</link>
      <description>&lt;P&gt;Hi Mike,&lt;/P&gt;
&lt;P&gt;The reason your first formula worked, is the use of the TOTAL qualifier - it allowed you to sum up amounts for previous year, even though they are not associated with the Year in the Dimension.&lt;/P&gt;
&lt;P&gt;I believe you should do something similar for the total by Category:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if(Year= $(vSelectedYear),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sum(total &lt;STRONG&gt;&amp;lt;Category&amp;gt;&lt;/STRONG&gt; {&amp;lt;Year= {"$(=$(vPreviousYear))"}&amp;gt;} Amount)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;As an alternative, you could implement the "As of Date" table with conditional flags, which would offer a much more scalable solution, but it involves a lot more work.&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 14:52:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2429374#M96426</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2024-03-11T14:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Previous year in 2nd dimensionality</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2429375#M96427</link>
      <description>&lt;P&gt;Hi Oleg,&lt;/P&gt;
&lt;P&gt;the formula you provided works perfectly! Thank you very much!&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 14:58:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2429375#M96427</guid>
      <dc:creator>mike_spada</dc:creator>
      <dc:date>2024-03-11T14:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Previous year in 2nd dimensionality</title>
      <link>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2430999#M96591</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Have you tried using the aggr(&lt;A href="https://thelost.net/" target="_self"&gt;find lost children&lt;/A&gt;) function with the Category field? It might help in replicating the pivot structure for previous years. &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 20:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Previous-year-in-2nd-dimensionality/m-p/2430999#M96591</guid>
      <dc:creator>jackysins72</dc:creator>
      <dc:date>2024-03-14T20:00:51Z</dc:date>
    </item>
  </channel>
</rss>

