<?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: How to return null() when using MAX and group BY() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889115#M657352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are several ways possible. One is to replace the NULL before you aggregated it (directly within a load per if-loop, or per NullAsValue or per Null-Mapping). Another could be to use peek/previous in a sorted load to flag the latest delivery date. Further a pick on concat() on these field is also a possibility. At first I would try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;max(if([Delivery date] &amp;gt;= 1, [Delivery date], 1000000)&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 May 2015 14:41:30 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-05-19T14:41:30Z</dc:date>
    <item>
      <title>How to return null() when using MAX and group BY()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889113#M657350</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 am calculating if a product was delivered on time, sometimes there can be many deliveries of the same product, i need the latest deliver to be the time used against the expected delivery, but sometimes one of the deliveries has no date insterted yet, and it will use the max date instead of the null()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Position&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expected date&amp;nbsp;&amp;nbsp;&amp;nbsp; Delivery date&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/04/2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03/04/2015&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/04/2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result after:&amp;nbsp; expected date, max(Delivery date) , Group by position;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Position&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expected date&amp;nbsp;&amp;nbsp;&amp;nbsp; Delivery date&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/04/2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03/04/2015&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;What i need:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Position&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expected date&amp;nbsp;&amp;nbsp;&amp;nbsp; Delivery date&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/04/2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Null()&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;The use of MAX is necessary since sometimes instead of null() i could have 04/04/2015, so it will display the latest delivery.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;How do i get the max when is necessary, and the null() when one input is set to null()?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 14:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889113#M657350</guid>
      <dc:creator />
      <dc:date>2015-05-19T14:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to return null() when using MAX and group BY()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889114#M657351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe try an expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= If( NullCount([Delivery date]), NULL(), Max([Delivery date]) )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 14:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889114#M657351</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-05-19T14:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to return null() when using MAX and group BY()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889115#M657352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are several ways possible. One is to replace the NULL before you aggregated it (directly within a load per if-loop, or per NullAsValue or per Null-Mapping). Another could be to use peek/previous in a sorted load to flag the latest delivery date. Further a pick on concat() on these field is also a possibility. At first I would try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;max(if([Delivery date] &amp;gt;= 1, [Delivery date], 1000000)&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 14:41:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889115#M657352</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-05-19T14:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to return null() when using MAX and group BY()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889116#M657353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but Marcus answer worked really good!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 19:44:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889116#M657353</guid>
      <dc:creator />
      <dc:date>2015-05-19T19:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to return null() when using MAX and group BY()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889117#M657354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect! Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 19:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-return-null-when-using-MAX-and-group-BY/m-p/889117#M657354</guid>
      <dc:creator />
      <dc:date>2015-05-19T19:44:30Z</dc:date>
    </item>
  </channel>
</rss>

