<?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: an If clause with weird behavior in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54596#M9062</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my simple test, it seems to be working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/201499_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2018 11:52:53 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-05-04T11:52:53Z</dc:date>
    <item>
      <title>an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54595#M9061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;Note: &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;I found a way, that I do not have to use an If clause there, so I do not need an answer anymore, but I am still interested, why this did not work.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently am realy confused with an if clause... I try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Not x=y,a,b)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If x=y I actually get b. But when x is not y I do not get a.&lt;/P&gt;&lt;P&gt;How is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In actuallity x is a max value of a date, y is a variable (also date). a is another expression in the same chart an b is a bit complicated but actually works. It is not nice to look at but here you go:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Not Max({&amp;lt;MMM.YY = ,year = ,Type={'Ist'}&amp;gt;}MMM.YY)=PMM_Date_auto,&lt;/P&gt;&lt;P&gt;[AE Ist],&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;MMM.YY = ,year = &amp;gt;}If(MMM.YY=MonthStart(Today(0)),AE.Netto*UKURS))&lt;/P&gt;&lt;P&gt;/NetWorkDays(MonthStart(Today(0)),MAX({&amp;lt;MMM.YY = ,year = &amp;gt;}True_Date),$(vPublicHolidays))&lt;/P&gt;&lt;P&gt;*NetWorkDays(MonthStart(Today(0)),MonthEnd(Today(0)),$(vPublicHolidays))&lt;/P&gt;&lt;P&gt;+SUM({&amp;lt;MMM.YY = ,year = &amp;gt;}If(MMM.YY&amp;lt;MonthStart(Today(0)) And MMM.YY&amp;gt;=YearStart(Today(0)),AE.Netto*UKURS)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone an idea what the problem could be?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 11:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54595#M9061</guid>
      <dc:creator>max_potass</dc:creator>
      <dc:date>2018-05-04T11:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54596#M9062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my simple test, it seems to be working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/201499_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 11:52:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54596#M9062</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-04T11:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54597#M9063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One reason could be that you cannot compare anything to a NULL value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 11:54:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54597#M9063</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2018-05-04T11:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54598#M9064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you just do this &lt;STRONG&gt;If(x=y, 'b', 'a')&lt;/STRONG&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: #3d3d3d;"&gt;&lt;STRONG&gt;If(Max({&amp;lt;MMM.YY, year, Type = {'Ist'}&amp;gt;} MMM.YY) = PMM_Date_auto,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Sum({&amp;lt;MMM.YY, year&amp;gt;} If(MMM.YY = MonthStart(Today(0)), AE.Netto*UKURS))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;/NetWorkDays(MonthStart(Today(0)),MAX({&amp;lt;MMM.YY = ,year = &amp;gt;}True_Date),$(vPublicHolidays))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;*NetWorkDays(MonthStart(Today(0)),MonthEnd(Today(0)),$(vPublicHolidays))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;+SUM({&amp;lt;MMM.YY = ,year = &amp;gt;}If(MMM.YY&amp;lt;MonthStart(Today(0)) And MMM.YY&amp;gt;=YearStart(Today(0)),AE.Netto*UKURS)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;[AE Ist])&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 11:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54598#M9064</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-04T11:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54599#M9065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to change that in several expressions and with the not it actually is faster to paste. Thanks for the fast response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 11:57:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54599#M9065</guid>
      <dc:creator>max_potass</dc:creator>
      <dc:date>2018-05-04T11:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54600#M9066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the reason is that there is no aggregation by [AE Ist] and if there are more than value available it will return NULL. Therefore try if min/max/avg([AE Ist]) change it (and return the right results).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 11:57:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54600#M9066</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-04T11:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54601#M9067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if an error occurs, it breaks the if. I see.&lt;/P&gt;&lt;P&gt;But it actually cannot be a null value, otherwise the whole expression cannot work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 11:58:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54601#M9067</guid>
      <dc:creator>max_potass</dc:creator>
      <dc:date>2018-05-04T11:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54602#M9068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is only one Vaule in [AE Ist]. If i just use it as expression it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 12:00:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54602#M9068</guid>
      <dc:creator>max_potass</dc:creator>
      <dc:date>2018-05-04T12:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54603#M9069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know... I tested it, too. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 12:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54603#M9069</guid>
      <dc:creator>max_potass</dc:creator>
      <dc:date>2018-05-04T12:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54604#M9070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a way, that I do not have to use an If clause there, so I do not need an answer anymore, but I am still interested, why this did not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 12:01:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54604#M9070</guid>
      <dc:creator>max_potass</dc:creator>
      <dc:date>2018-05-04T12:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: an If clause with weird behavior</title>
      <link>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54605#M9071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, then the if statement is not the problem... it is something else... would you be able to share a sample where this isn't working?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 12:01:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/an-If-clause-with-weird-behavior/m-p/54605#M9071</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-04T12:01:57Z</dc:date>
    </item>
  </channel>
</rss>

