<?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 Compare current &amp;amp; previous periods with column dims in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025087#M84543</link>
    <description>&lt;P&gt;Hi People,&lt;/P&gt;
&lt;P&gt;I need to design a pivot which will enable comparing 2 periods, with a dynamic selection of periods.&lt;/P&gt;
&lt;P&gt;Current period can be from date - to date, based on the user selection in the calendar.&lt;/P&gt;
&lt;P&gt;Previous period - is calculated for the previous year.&lt;/P&gt;
&lt;P&gt;So the same expressions are displayed for both periods.&lt;/P&gt;
&lt;P&gt;I would appreciate some tips for achieving it.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PIVOT  current and previous.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/97911i7BACB4BB13184CE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="PIVOT  current and previous.png" alt="PIVOT  current and previous.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2023 16:47:27 GMT</pubDate>
    <dc:creator>dana</dc:creator>
    <dc:date>2023-01-12T16:47:27Z</dc:date>
    <item>
      <title>Compare current &amp; previous periods with column dims</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025087#M84543</link>
      <description>&lt;P&gt;Hi People,&lt;/P&gt;
&lt;P&gt;I need to design a pivot which will enable comparing 2 periods, with a dynamic selection of periods.&lt;/P&gt;
&lt;P&gt;Current period can be from date - to date, based on the user selection in the calendar.&lt;/P&gt;
&lt;P&gt;Previous period - is calculated for the previous year.&lt;/P&gt;
&lt;P&gt;So the same expressions are displayed for both periods.&lt;/P&gt;
&lt;P&gt;I would appreciate some tips for achieving it.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PIVOT  current and previous.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/97911i7BACB4BB13184CE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="PIVOT  current and previous.png" alt="PIVOT  current and previous.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 16:47:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025087#M84543</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2023-01-12T16:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compare current &amp; previous periods with column dims</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025307#M84556</link>
      <description>&lt;P&gt;Use a Calculated Dimension in this case&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Row Dimension&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=Supplier&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Column Dimension&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Period (level1)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=&amp;nbsp; Aggr( only({&amp;lt;Datefield = {"&amp;gt;=$(=YearStart(Max(Date)))&amp;lt;=&lt;SPAN&gt;$(=Max(Date))&lt;/SPAN&gt;"}&amp;gt;+&amp;lt;&lt;SPAN&gt;Datefield = {"&amp;gt;=$(=YearStart(Max(Date),-1))&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;$(=AddYears(Max(Date),-1))&lt;/SPAN&gt;&lt;SPAN&gt;"}&lt;/SPAN&gt;&amp;gt; }Datefield )&amp;nbsp; &amp;nbsp;,Datefield)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 08:23:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025307#M84556</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2023-01-13T08:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Compare current &amp; previous periods with column dims</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025457#M84566</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Vineeth,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;After applying the expression, looks like the ranges are calculated properly:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CALCULATED PERIODS 1.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/97982iC61BFC6DD0B204F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="CALCULATED PERIODS 1.png" alt="CALCULATED PERIODS 1.png" /&gt;&lt;/span&gt;&amp;nbsp; The issues are:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Current period shows only the month selected, and not the range.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The previous periods are calculated properly, but not displayed at all in the pivot.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please see the filter object&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CALCULATED PERIODS 2.png" style="width: 511px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/97984i0A730E9EE25AB822/image-dimensions/511x330?v=v2" width="511" height="330" role="button" title="CALCULATED PERIODS 2.png" alt="CALCULATED PERIODS 2.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I can't figure out the reason for that..&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Edit:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;In the pivot table, I don't want to show the months, but the relevant range only...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Is it feasible?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How would the table expression sync with it?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Will appreciate your help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 12:40:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025457#M84566</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2023-01-13T12:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Compare current &amp; previous periods with column dims</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025609#M84575</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I defined two variables for the current and previous periods:&lt;/P&gt;
&lt;P&gt;vCurrentPeriod:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=Dual(Date(YearStart(Min(MonthDate))) &amp;amp; '-' &amp;amp; Date(Max(MonthDate)),2)&lt;/P&gt;
&lt;P&gt;vPreviousPeriod:&lt;/P&gt;
&lt;P&gt;= Dual(Date(YearStart(Min(MonthDate),-1)) &amp;amp; '-' &amp;amp; Date(AddYears(Max(MonthDate),-1)),1)&lt;/P&gt;
&lt;P&gt;I used ValueList to create my periods dimension in the pivot table:&lt;/P&gt;
&lt;P&gt;=ValueList(vCurrentPeriod,vPreviousPeriod)&lt;/P&gt;
&lt;P&gt;I added to the expressions an If:&lt;/P&gt;
&lt;P&gt;=If(ValueList(vCurrentPeriod,vPreviousPeriod) =vCurrentPeriod,&lt;BR /&gt;Sum({&amp;lt;Year = {'$(vCurrentYear)'},Date={"&amp;lt;=$(vMaxDate)"}&amp;gt;}CountEntries_Monthly),&lt;BR /&gt;Sum({&amp;lt;Year = {'$(vPreviousYear)'},Date={"&amp;lt;=$(vMaxDate_PrevYear)"}&amp;gt;}CountEntries_Monthly))&lt;/P&gt;
&lt;P&gt;And it does what I want!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 15:39:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-current-amp-previous-periods-with-column-dims/m-p/2025609#M84575</guid>
      <dc:creator>dana</dc:creator>
      <dc:date>2023-01-13T15:39:13Z</dc:date>
    </item>
  </channel>
</rss>

