<?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: If-statement for Previous 12 Months in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540937#M599117</link>
    <description>&lt;PRE&gt;pick(Match(Month,month(today()),month(addmonth(today(),-1)),month(addmonth(today(),-2)),month(addmonth(today(),-3)),month(addmonth(today(),-4)),month(addmonth(today(),-5)),month(addmonth(today(),-6)),month(addmonth(today(),-7)),month(addmonth(today(),-8,)),month(addmonth(today(),-9)),month(addmonth(today(),-10)),month(addmonth(today(),-11))),1,2,3,4,5,6,7,8,9,10,11,12)&lt;/PRE&gt;&lt;P&gt;Try the above if month is the dimension . Please check the performance as it contains addmomth() 11 times.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Feb 2019 13:59:31 GMT</pubDate>
    <dc:creator>pradosh_thakur</dc:creator>
    <dc:date>2019-02-07T13:59:31Z</dc:date>
    <item>
      <title>If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540288#M599107</link>
      <description>&lt;P&gt;In my Master Calendar in my Edit Script I have used the following:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;If&lt;/FONT&gt;(&lt;FONT color="#800000"&gt;Datum&lt;/FONT&gt; &amp;lt;= &lt;FONT color="#0000ff"&gt;Today&lt;/FONT&gt;() &lt;FONT color="#0000ff"&gt;And&lt;/FONT&gt; &lt;FONT color="#800000"&gt;Datum&lt;/FONT&gt; &amp;gt;= &lt;FONT color="#0000ff"&gt;SetDateYear&lt;/FONT&gt;(&lt;FONT color="#0000ff"&gt;Today&lt;/FONT&gt;(), &lt;FONT color="#0000ff"&gt;Year&lt;/FONT&gt;(&lt;FONT color="#0000ff"&gt;Today&lt;/FONT&gt;())-1), 1, 0) &lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt; &lt;FONT color="#800000"&gt;Last12Months &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;&lt;FONT color="#800000"&gt;Now I want to add a similar If-statement for Previous 12 Months. How do I script this (in a similar way as above)?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;&lt;FONT color="#800000"&gt;&lt;FONT color="#800000"&gt;&lt;FONT color="#800000"&gt;I am using this to be able to compare data for the last 12 months and the previous 12 months a year earlier. In a bar chart for example.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:27:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540288#M599107</guid>
      <dc:creator>ktdewit1976</dc:creator>
      <dc:date>2024-11-16T21:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540294#M599108</link>
      <description>May be this&lt;BR /&gt;If(Datum &amp;lt;= SetDateYear(Today(), Year(Today())-1) And Datum &amp;gt;= SetDateYear(Today(), Year(Today())-2), 1, 0) As Previous12Months</description>
      <pubDate>Wed, 06 Feb 2019 13:54:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540294#M599108</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2019-02-06T13:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540299#M599109</link>
      <description>&lt;P&gt;try this :&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;If&lt;/FONT&gt;(&lt;FONT color="#800000"&gt;Datum&lt;/FONT&gt;&amp;nbsp;&amp;lt;=&amp;nbsp;&lt;FONT color="#0000ff"&gt;Today&lt;/FONT&gt;()&amp;nbsp;&lt;FONT color="#0000ff"&gt;And&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#800000"&gt;Datum&lt;/FONT&gt;&amp;nbsp;&amp;gt;= AddMonths(&lt;FONT color="#0000ff"&gt;Today&lt;/FONT&gt;(),&amp;nbsp;&lt;FONT color="#0000ff"&gt;-12)&lt;/FONT&gt;, 1, 0)&amp;nbsp;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#800000"&gt;Last12Months&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;Regards!!!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 13:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540299#M599109</guid>
      <dc:creator>Marcos_rv</dc:creator>
      <dc:date>2019-02-06T13:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540300#M599110</link>
      <description>&lt;P&gt;I would try these instead&lt;/P&gt;&lt;P&gt;Last12Months&lt;/P&gt;&lt;PRE&gt;If(Datum &amp;lt;= Today() And Datum &amp;gt;= AddYears(Today(), -1), 1, 0) as Last12Months&lt;/PRE&gt;&lt;P&gt;Previous12Months&lt;/P&gt;&lt;PRE&gt;If(Datum &amp;lt;= AddYears(Today(), -1) And Datum &amp;gt;= AddYears(Today(), -2), 1, 0) as Previous12Months&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Feb 2019 13:57:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540300#M599110</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-06T13:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540749#M599111</link>
      <description>&lt;P&gt;Now the graph looks like this. I did use MonthYear though instead of Month. When I use Month it does give the bars for each month next to each other. But the month January should be last in row, and it shows first in row. How do I solve 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="Last and previous months.jpeg" style="width: 955px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5399iDAF552AAB2A3486A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Last and previous months.jpeg" alt="Last and previous months.jpeg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 10:08:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540749#M599111</guid>
      <dc:creator>ktdewit1976</dc:creator>
      <dc:date>2019-02-07T10:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540871#M599112</link>
      <description>&lt;P&gt;May be use Month as a dimension instead of MonthYear here&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 12:25:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540871#M599112</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-07T12:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540910#M599113</link>
      <description>&lt;P&gt;But then January 2019 shows on the left instead of the right. It is supposed to be a dynamic graph that changes when the date changes.&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="Data per month.jpeg" style="width: 955px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5427iB10098F6D292C50E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Data per month.jpeg" alt="Data per month.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 13:31:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540910#M599113</guid>
      <dc:creator>ktdewit1976</dc:creator>
      <dc:date>2019-02-07T13:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540916#M599114</link>
      <description>&lt;P&gt;Use a sort expression to fix this... it shouldn't be too hard to use a sort expression. If you are unable to do this, please share a sample so that we can try out and get you the right sort expression&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 13:40:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540916#M599114</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-07T13:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540919#M599115</link>
      <description>&lt;P&gt;I tried all different ways of sorting, but none gives me sort by date. I guess because it only recognizes Month when using that as a Dimension?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 13:44:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540919#M599115</guid>
      <dc:creator>ktdewit1976</dc:creator>
      <dc:date>2019-02-07T13:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540926#M599116</link>
      <description>&lt;P&gt;Try using a sort expression like this&lt;/P&gt;&lt;PRE&gt;Max(MonthYear)&lt;/PRE&gt;&lt;P&gt;If that still doesn't work, please share a sample file&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 13:51:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540926#M599116</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-07T13:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540937#M599117</link>
      <description>&lt;PRE&gt;pick(Match(Month,month(today()),month(addmonth(today(),-1)),month(addmonth(today(),-2)),month(addmonth(today(),-3)),month(addmonth(today(),-4)),month(addmonth(today(),-5)),month(addmonth(today(),-6)),month(addmonth(today(),-7)),month(addmonth(today(),-8,)),month(addmonth(today(),-9)),month(addmonth(today(),-10)),month(addmonth(today(),-11))),1,2,3,4,5,6,7,8,9,10,11,12)&lt;/PRE&gt;&lt;P&gt;Try the above if month is the dimension . Please check the performance as it contains addmomth() 11 times.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 13:59:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540937#M599117</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2019-02-07T13:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540946#M599119</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16186"&gt;@pradosh_thakur&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;PRE&gt;pick(Match(Month,month(today()),month(addmonth(today(),-1)),month(addmonth(today(),-2)),month(addmonth(today(),-3)),month(addmonth(today(),-4)),month(addmonth(today(),-5)),month(addmonth(today(),-6)),month(addmonth(today(),-7)),month(addmonth(today(),-8,)),month(addmonth(today(),-9)),month(addmonth(today(),-10)),month(addmonth(today(),-11))),1,2,3,4,5,6,7,8,9,10,11,12)&lt;/PRE&gt;&lt;P&gt;Try the above if month is the dimension . Please check the performance as it contains addmomth() 11 times.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You are really complicating it. I don't think we need this.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 14:02:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540946#M599119</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-07T14:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540947#M599120</link>
      <description>That worked. Thanks Sunny!</description>
      <pubDate>Thu, 07 Feb 2019 14:02:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540947#M599120</guid>
      <dc:creator>ktdewit1976</dc:creator>
      <dc:date>2019-02-07T14:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: If-statement for Previous 12 Months</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540951#M599121</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You are really complicating it. I don't think we need this.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yeah. It's really over complicated.&amp;nbsp; Just thought too much i guess. I was trying to get jan to the last and didn't think of the simpler solution.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 14:07:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-for-Previous-12-Months/m-p/1540951#M599121</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2019-02-07T14:07:17Z</dc:date>
    </item>
  </channel>
</rss>

