<?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: How to implement CY and PY in the same row in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2033087#M85122</link>
    <description>&lt;P&gt;As below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;Dimension&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;= cod_year&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;Measure&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;CY =&amp;nbsp;sum({&amp;lt;cod_year={"$(=MAx(cod_year))"}&amp;gt;}Measures)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;PY =&amp;nbsp;sum(aggr(sum({&amp;lt;cod_year={"$(=MAx(cod_year)-1)"}&amp;gt;} TOTAL Measures),cod_year))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 03:17:04 GMT</pubDate>
    <dc:creator>vinieme12</dc:creator>
    <dc:date>2023-02-02T03:17:04Z</dc:date>
    <item>
      <title>How to implement CY and PY in the same row</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2032903#M85108</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I'm trying to implement a simple set analysis where the user choose a year and the table should appear like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aresb_2-1675265046510.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99455iF4DDACD0B7777CBE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aresb_2-1675265046510.png" alt="aresb_2-1675265046510.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when i implement the below set expression and selecting year 2022 as filter i have this,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({$&amp;lt;cod_year={$(=MAX(cod_year)-1)}&amp;gt;}Measures)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have this results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aresb_3-1675265134570.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99456iE0CA76193D2B53BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aresb_3-1675265134570.png" alt="aresb_3-1675265134570.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there a way to achieve the result in the first image?&lt;/P&gt;
&lt;P&gt;Even via data load editor&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 15:27:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2032903#M85108</guid>
      <dc:creator>aresb</dc:creator>
      <dc:date>2023-02-01T15:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement CY and PY in the same row</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2032935#M85115</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/163577"&gt;@aresb&lt;/a&gt;&amp;nbsp;you can try creating a chart table with 3 expressions, no dimensions.&lt;/P&gt;
&lt;P&gt;Please check if this example works for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;P&gt;Load * INLINE [&lt;BR /&gt;cod_year, Measures&lt;BR /&gt;2022, 3000&lt;BR /&gt;2021, 5000&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;exit script;&lt;/P&gt;
&lt;P&gt;chart&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QFabian_0-1675268095935.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99459i055448C51B21A228/image-size/large?v=v2&amp;amp;px=999" role="button" title="QFabian_0-1675268095935.png" alt="QFabian_0-1675268095935.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Year = only(cod_year)&lt;/P&gt;
&lt;P&gt;Measures CY&amp;nbsp;=&amp;nbsp;SUM(Measures)&lt;/P&gt;
&lt;P&gt;Measures PY =&amp;nbsp; SUM({$&amp;lt;cod_year={$(=MAX(cod_year)-1)}&amp;gt;}Measures)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 16:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2032935#M85115</guid>
      <dc:creator>QFabian</dc:creator>
      <dc:date>2023-02-01T16:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement CY and PY in the same row</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2033087#M85122</link>
      <description>&lt;P&gt;As below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;Dimension&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;= cod_year&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;Measure&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;CY =&amp;nbsp;sum({&amp;lt;cod_year={"$(=MAx(cod_year))"}&amp;gt;}Measures)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;PY =&amp;nbsp;sum(aggr(sum({&amp;lt;cod_year={"$(=MAx(cod_year)-1)"}&amp;gt;} TOTAL Measures),cod_year))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 03:17:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2033087#M85122</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2023-02-02T03:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement CY and PY in the same row</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2038253#M85535</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;i 've solved this way&amp;nbsp; in the data load editor&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure_CY:
LOAD
    "Year",
    "Month",
    Measures as Measure_CY,
    Date#("Year" &amp;amp; "Month",'YYYYMM') as id_date,
    Date#("Year" &amp;amp; "Month"+100,'YYYYMM') as id_date_1
    
FROM [lib://m/Misura PY qlik.xlsx]
(ooxml, embedded labels, table is Foglio1);

NoConcatenate[Measure_CY]:

Load

Date#(id_date_1,'YYYYMM') as id_date,
Measure_CY as Measure_PY
Resident Measure_CY
WHERE YEAR(Date(id_date_1,'YYYYMM')) &amp;lt;= YEAR(now());
drop Field id_date_1





&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which give me this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aresb_0-1676469612325.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/100579i03322D390F430561/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aresb_0-1676469612325.png" alt="aresb_0-1676469612325.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 14:00:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-implement-CY-and-PY-in-the-same-row/m-p/2038253#M85535</guid>
      <dc:creator>aresb</dc:creator>
      <dc:date>2023-02-15T14:00:20Z</dc:date>
    </item>
  </channel>
</rss>

