<?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: Compare this year data vs last year data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077713#M1223907</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/214178"&gt;@Vinni2000&lt;/a&gt;&amp;nbsp; First create Calendar using InvoiceDate which contains Year &amp;amp; Month calculated using Invoice Date. Then create Bar chart with two dimension, 'Group' Month and 'Bars' as Year. Use below expression&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum({&amp;lt;Year = {"&amp;gt;=$(=max(Year)-1)"}&amp;gt;}Amount)&lt;/LI-CODE&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="Screenshot 2023-05-30 at 11.44.23.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/108620i237746AC70D36E7B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-30 at 11.44.23.png" alt="Screenshot 2023-05-30 at 11.44.23.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 May 2023 10:48:07 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2023-05-30T10:48:07Z</dc:date>
    <item>
      <title>Compare this year data vs last year data</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2076812#M1223867</link>
      <description>&lt;P&gt;&amp;nbsp;I have invoice date '20200831' format in purchase order data so now i want to compare thise year purchase amount vs last year purchase amount by months using bar chart .&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 12:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2076812#M1223867</guid>
      <dc:creator>Vinni2000</dc:creator>
      <dc:date>2023-05-26T12:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compare this year data vs last year data</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077399#M1223893</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IMG_20230526_192937.jpg" style="width: 3072px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/108556i21AC05BB741E399A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IMG_20230526_192937.jpg" alt="IMG_20230526_192937.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; i want my bar chart like this like i want to compare last 12 months data with previous 12 months data&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 15:28:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077399#M1223893</guid>
      <dc:creator>Vinni2000</dc:creator>
      <dc:date>2023-05-29T15:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compare this year data vs last year data</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077713#M1223907</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/214178"&gt;@Vinni2000&lt;/a&gt;&amp;nbsp; First create Calendar using InvoiceDate which contains Year &amp;amp; Month calculated using Invoice Date. Then create Bar chart with two dimension, 'Group' Month and 'Bars' as Year. Use below expression&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum({&amp;lt;Year = {"&amp;gt;=$(=max(Year)-1)"}&amp;gt;}Amount)&lt;/LI-CODE&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="Screenshot 2023-05-30 at 11.44.23.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/108620i237746AC70D36E7B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-30 at 11.44.23.png" alt="Screenshot 2023-05-30 at 11.44.23.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 10:48:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077713#M1223907</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-30T10:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compare this year data vs last year data</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077737#M1223909</link>
      <description>&lt;P&gt;Yeah I did the same and created month and year field from invoice create date using month() and year() then used same measures but i don't want that i want to compare this last 12 months means 2022 june to 2023 May with previous last 12 months means 2021 june to 2022 May&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 11:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077737#M1223909</guid>
      <dc:creator>Vinni2000</dc:creator>
      <dc:date>2023-05-30T11:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Compare this year data vs last year data</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077876#M1223926</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/214178"&gt;@Vinni2000&lt;/a&gt;&amp;nbsp; Considering you have calendar on required date. Create a Flag like below in Calendar&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calendar:
LOAD *,monthname(Date) as MonthYear,
     if(Date&amp;gt;= monthstart(addmonths(Today(),-11)) and Date &amp;lt;=Today(),'Last12Months',
     if(Date&amp;gt;= monthstart(addmonths(Today(),-23)) and Date&amp;lt;= monthend(addmonths(Today(),-12)) ,'PreviousLast12Months')) as Flag;

Month:
Load Distinct Month ,MonthYear
Resident Calendar
where Flag='Last12Months';

month_sort:
Load Month, RowNo() as Sort_month
Resident Month
Order by MonthYear;

Drop Table Month;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a bar chart with Dimension Month and below expression&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last12Month: Sum({&amp;lt;Flag={"Last12Months"}&amp;gt;}Sales)
Expression label: =text(monthname(min({&amp;lt;Flag={"Last12Months"}&amp;gt;}Date)))&amp;amp;'-'&amp;amp;text(monthname(max({&amp;lt;Flag={"Last12Months"}&amp;gt;}Date)))

PreviousLast12Month: Sum({&amp;lt;Flag={"PreviousLast12Months"}&amp;gt;}Sales)
Expression label: =text(monthname(min({&amp;lt;Flag={"PreviousLast12Months"}&amp;gt;}Date)))&amp;amp;'-'&amp;amp;text(monthname(max({&amp;lt;Flag={"PreviousLast12Months"}&amp;gt;}Date)))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sort your Month Dimension by Expression&lt;STRONG&gt; =Sort_month&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-05-30 at 15.27.19.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/108652i7220150004676161/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-30 at 15.27.19.png" alt="Screenshot 2023-05-30 at 15.27.19.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 14:27:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-this-year-data-vs-last-year-data/m-p/2077876#M1223926</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-30T14:27:51Z</dc:date>
    </item>
  </channel>
</rss>

