<?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: Invalid expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700822#M252976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If possible could you attach a sample source for that script??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Sep 2014 21:59:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-09-25T21:59:59Z</dc:date>
    <item>
      <title>Invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700820#M252974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have the following invalid expression and cannot understand why it is throwing error.&lt;/P&gt;&lt;P&gt;any experts who can perhaps point me in the right direction?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invalid expression&lt;/P&gt;&lt;P&gt;KALKYL:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;DISTINCT %Key,&lt;/P&gt;&lt;P&gt;if(isNull(TILLTRADE_TOM),&lt;/P&gt;&lt;P&gt;DATE(MAX(PREVIOUS(TILLTRADE_FOM),&lt;/P&gt;&lt;P&gt;DATE(MAX(TILLTRADE_FOM))))) AS TEST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESIDENT TEMP1&lt;/P&gt;&lt;P&gt;GROUP BY %Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 21:11:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700820#M252974</guid>
      <dc:creator />
      <dc:date>2014-09-25T21:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700821#M252975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;from the syntax side, you have a group by, so you need an aggr function &lt;/P&gt;&lt;P&gt;like this&lt;/P&gt;&lt;P&gt;max(if(isNull(d), DATE((PREVIOUS(d))), DATE((d)))) AS TEST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;don't know if it makes sense&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 21:35:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700821#M252975</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-09-25T21:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700822#M252976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If possible could you attach a sample source for that script??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 21:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700822#M252976</guid>
      <dc:creator />
      <dc:date>2014-09-25T21:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700823#M252977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess you would like to get the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Group the data by %Key. For each group, get the max of field TILLTRADE_FOM and return it as a date. But in case all the data of a group only has NULLs in the field, get the max of the previous group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If my assumption is correct you could do it as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, perform the group by and calculate the max(TILLTRADE_FOM) and create a new table with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a second step, read in this table and check, where you got NULL as max and replace it by the result of the previous row (group of rows in your original data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise: Could you describe what you would like to get? Could you provide sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 16:51:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression/m-p/700823#M252977</guid>
      <dc:creator>hewemel1</dc:creator>
      <dc:date>2014-09-26T16:51:19Z</dc:date>
    </item>
  </channel>
</rss>

