<?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 Condition on Year in Variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259299#M517028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this case a selection is made on Calendar Month but not on Month.&lt;/P&gt;&lt;P&gt;So how it will take values from dimension?&lt;/P&gt;&lt;P&gt;I am suing the below:&lt;/P&gt;&lt;P&gt;=If(GetFieldSelections(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px; background-color: #f2f2f2;"&gt;[Calendar Month]&lt;/SPAN&gt;)='Jan',Year(AddYears(Date#(Year, 'YYYY'), -1)),&lt;/P&gt;&lt;P&gt;If(GetFieldSelections(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px; background-color: #f2f2f2;"&gt;[Calendar Month]&lt;/SPAN&gt;)='Feb' ,If(Month='M' or 'M-1',Year(AddYears(Date#(Year, 'YYYY'), -1))&lt;/P&gt;&lt;P&gt;),Year))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also with your query it will only give values for current year. What if we select calendar month &amp;amp; Previous year with Feb?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Mar 2017 13:57:46 GMT</pubDate>
    <dc:creator>shanky1907</dc:creator>
    <dc:date>2017-03-22T13:57:46Z</dc:date>
    <item>
      <title>If Condition on Year in Variable</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259297#M517026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Problem with one of my variable:&lt;/P&gt;&lt;P&gt;Problem Scenario:&lt;/P&gt;&lt;P&gt;I have an Inline field as Month : Which is Horizontal Dimension in my pivot chart&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid rgb(0, 0, 0); width: 52px; height: 80px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Month&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;M&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;M-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;M-2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and a Calendar month field as &lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Jan&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Feb&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mar&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Apr&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;May&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jun&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jul&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Aug&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Sept&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Oct&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Nov&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Dec&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and Year as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, The issue is only when we select 'Feb' or 'Jan' in Month Filter,&lt;/P&gt;&lt;P&gt;I want to set a variable for Year like If i select Jan, then for M the vYear should be Currentyear and for M-1 &amp;amp; M-2 it should be Currentyear-1.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;If i select Feb, then for M &amp;amp; M-1 the vYear should be Currentyear and for M-2 it should be Currentyear-1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Can anyone please help me write the syntax for it.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 13:16:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259297#M517026</guid>
      <dc:creator>shanky1907</dc:creator>
      <dc:date>2017-03-22T13:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition on Year in Variable</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259298#M517027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some thing like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vYear &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if([Calendar Month]='Jan' and Month='M' ,Year(today()),&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if([Calendar Month]='Jan' and (Month='M-1'&amp;nbsp; or &lt;SPAN style="font-size: 13.3333px;"&gt;Month='M-2' &lt;/SPAN&gt;,Year(today())-1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;if([Calendar Month]='Feb' and Month='M-2' ,&lt;SPAN style="font-size: 13.3333px;"&gt;Year(today())-1&lt;/SPAN&gt;,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if([Calendar Month]='Jan' and (Month='M-1'&amp;nbsp; or &lt;SPAN style="font-size: 13.3333px;"&gt;Month='M' &lt;/SPAN&gt;,&lt;SPAN style="font-size: 13.3333px;"&gt;Year(today())&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 13:51:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259298#M517027</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2017-03-22T13:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition on Year in Variable</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259299#M517028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this case a selection is made on Calendar Month but not on Month.&lt;/P&gt;&lt;P&gt;So how it will take values from dimension?&lt;/P&gt;&lt;P&gt;I am suing the below:&lt;/P&gt;&lt;P&gt;=If(GetFieldSelections(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px; background-color: #f2f2f2;"&gt;[Calendar Month]&lt;/SPAN&gt;)='Jan',Year(AddYears(Date#(Year, 'YYYY'), -1)),&lt;/P&gt;&lt;P&gt;If(GetFieldSelections(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px; background-color: #f2f2f2;"&gt;[Calendar Month]&lt;/SPAN&gt;)='Feb' ,If(Month='M' or 'M-1',Year(AddYears(Date#(Year, 'YYYY'), -1))&lt;/P&gt;&lt;P&gt;),Year))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also with your query it will only give values for current year. What if we select calendar month &amp;amp; Previous year with Feb?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 13:57:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259299#M517028</guid>
      <dc:creator>shanky1907</dc:creator>
      <dc:date>2017-03-22T13:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition on Year in Variable</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259300#M517029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;but you had mentioned as &lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Currentyear &lt;/SPAN&gt;rite ?&amp;nbsp; so I had given the above expression &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;try like this &lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;=If(GetFieldSelections(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; color: #3d3d3d; background-color: #f2f2f2;"&gt;[Calendar Month]&lt;/SPAN&gt;)='Jan',&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;if(&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;GetFieldSelections&lt;/SPAN&gt;(Year)=1,Year(AddYears(Date#(Year, 'YYYY'), -1)), &lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Year(today())-1&lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;If(GetFieldSelections(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; color: #3d3d3d; background-color: #f2f2f2;"&gt;[Calendar Month]&lt;/SPAN&gt;)='Feb' ,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;If(Month='M' or 'M-1',&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;if(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;(Year)=1,&lt;/SPAN&gt;Year(AddYears(Date#(Year, 'YYYY'), -1))&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Year(today())-1&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;),&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Year))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 14:57:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-on-Year-in-Variable/m-p/1259300#M517029</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2017-03-22T14:57:17Z</dc:date>
    </item>
  </channel>
</rss>

