<?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 strange behaviour of sum with if condition on null values inside in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/strange-behaviour-of-sum-with-if-condition-on-null-values-inside/m-p/344872#M493729</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josè, thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first condition is false for req.ID=2 but for req.ID=1 it is true since there is no execution for that request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to put the sum within the if as you suggested, but it only works if i put one of the *.TIPO fields as dimensions. This is not what I want since I have to plot the result of my conditional sum over a time dimension (not represented in the simplified data I posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filippo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 May 2012 05:44:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-10T05:44:09Z</dc:date>
    <item>
      <title>strange behaviour of sum with if condition on null values inside</title>
      <link>https://community.qlik.com/t5/QlikView/strange-behaviour-of-sum-with-if-condition-on-null-values-inside/m-p/344870#M493727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following problem: I want to sum all values of a field where some associated dimensions are null. Here is my data script (very simplified version):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;exe:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exe.TIPO, exe.ID, req.ID, exe.N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXE,1, 2, 1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;req:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.TIPO, req.ID, req.N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REQ, 1,1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ans:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ans.TIPO, req.ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ANS, 1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just to summarize: I have requests (req) which can be executed or not (exe) and have answers (ans). I want to sum req.N for requests not executed (exe.TIPO=null) but answered (ans.TIPO&amp;lt;&amp;gt;null)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my expression: sum(if(len(exe.TIPO)=0 and len(ans.TIPO)&amp;gt;0,req.N))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I put it within a table chart I get 2 instead of one!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone has some answers? What am I doing wrong? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for all your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2012 17:09:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/strange-behaviour-of-sum-with-if-condition-on-null-values-inside/m-p/344870#M493727</guid>
      <dc:creator />
      <dc:date>2012-05-09T17:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: strange behaviour of sum with if condition on null values inside</title>
      <link>https://community.qlik.com/t5/QlikView/strange-behaviour-of-sum-with-if-condition-on-null-values-inside/m-p/344871#M493728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first condition is false, len(exe.TIPO) is 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(len(exe.TIPO)=0 and len(ans.TIPO)&amp;gt;0,sum(req.N))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2012 18:26:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/strange-behaviour-of-sum-with-if-condition-on-null-values-inside/m-p/344871#M493728</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-05-09T18:26:10Z</dc:date>
    </item>
    <item>
      <title>strange behaviour of sum with if condition on null values inside</title>
      <link>https://community.qlik.com/t5/QlikView/strange-behaviour-of-sum-with-if-condition-on-null-values-inside/m-p/344872#M493729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josè, thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first condition is false for req.ID=2 but for req.ID=1 it is true since there is no execution for that request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to put the sum within the if as you suggested, but it only works if i put one of the *.TIPO fields as dimensions. This is not what I want since I have to plot the result of my conditional sum over a time dimension (not represented in the simplified data I posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filippo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 05:44:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/strange-behaviour-of-sum-with-if-condition-on-null-values-inside/m-p/344872#M493729</guid>
      <dc:creator />
      <dc:date>2012-05-10T05:44:09Z</dc:date>
    </item>
  </channel>
</rss>

