<?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 IF condition not working properly in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IF-condition-not-working-properly/m-p/752373#M473216</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;neeelam123 wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Pivot table &lt;STRONG&gt;BG&lt;/STRONG&gt; looking like below showing JUN'14 data:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Qlikview.png" class="jive-image jiveImage" height="494" src="https://community.qlik.com/legacyfs/online/71349_Qlikview.png" width="1152" /&gt;&lt;/P&gt;&lt;P&gt;When I put the below condition in &lt;STRONG&gt;BG:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(TimePeriod='MTD',Sum({&amp;lt;[Transaction Type]=&amp;gt;}[Gross Budget]),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum ({&amp;lt;YrMonth = {"&amp;gt;=$(=yearstart(Date(VDateMax),0,1)) &amp;lt;=$(=Date(VDateMax))"},MonthName=,[Transaction Type]=&amp;gt;}[Gross Budget]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Transaction Type is only applicable for Actuals, so I had to Ignore it in Budget expression above through Set Analysis.&lt;/P&gt;&lt;P&gt;It gives me an extra product &lt;STRONG&gt;METACAM CATTLE&lt;/STRONG&gt; which is &lt;STRONG&gt;1090000&lt;/STRONG&gt; for MTD which is actually for MAY and not present for Jun, however YTD is correct since no values for this product in earlier months.&lt;/P&gt;&lt;P&gt;I have kept 2nd chart &lt;STRONG&gt;MTD&lt;/STRONG&gt; for reference which has 2 normal expressions for MTD and YTD and is showing correct data for the same product.&lt;/P&gt;&lt;P&gt;I hope you guys will be able to understand the above explanation. If not please let me know, I will try to further detail it. The sample QVW is also attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Neelam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Nov 2014 16:26:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-15T16:26:18Z</dc:date>
    <item>
      <title>IF condition not working properly</title>
      <link>https://community.qlik.com/t5/QlikView/IF-condition-not-working-properly/m-p/752373#M473216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;neeelam123 wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Pivot table &lt;STRONG&gt;BG&lt;/STRONG&gt; looking like below showing JUN'14 data:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Qlikview.png" class="jive-image jiveImage" height="494" src="https://community.qlik.com/legacyfs/online/71349_Qlikview.png" width="1152" /&gt;&lt;/P&gt;&lt;P&gt;When I put the below condition in &lt;STRONG&gt;BG:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(TimePeriod='MTD',Sum({&amp;lt;[Transaction Type]=&amp;gt;}[Gross Budget]),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum ({&amp;lt;YrMonth = {"&amp;gt;=$(=yearstart(Date(VDateMax),0,1)) &amp;lt;=$(=Date(VDateMax))"},MonthName=,[Transaction Type]=&amp;gt;}[Gross Budget]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Transaction Type is only applicable for Actuals, so I had to Ignore it in Budget expression above through Set Analysis.&lt;/P&gt;&lt;P&gt;It gives me an extra product &lt;STRONG&gt;METACAM CATTLE&lt;/STRONG&gt; which is &lt;STRONG&gt;1090000&lt;/STRONG&gt; for MTD which is actually for MAY and not present for Jun, however YTD is correct since no values for this product in earlier months.&lt;/P&gt;&lt;P&gt;I have kept 2nd chart &lt;STRONG&gt;MTD&lt;/STRONG&gt; for reference which has 2 normal expressions for MTD and YTD and is showing correct data for the same product.&lt;/P&gt;&lt;P&gt;I hope you guys will be able to understand the above explanation. If not please let me know, I will try to further detail it. The sample QVW is also attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Neelam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Nov 2014 16:26:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-condition-not-working-properly/m-p/752373#M473216</guid>
      <dc:creator />
      <dc:date>2014-11-15T16:26:18Z</dc:date>
    </item>
  </channel>
</rss>

