<?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 Error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634923#M679073</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you using it in your data model?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2014 12:29:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-05-15T12:29:42Z</dc:date>
    <item>
      <title>Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634922#M679072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have an expression which is running perfectly in the text box but when i use the same in my data model, its throwing an error called&amp;nbsp; 'Invalid Expression'. The expression is:&lt;/P&gt;&lt;P&gt;IF(SERVICE_INDICATOR='AESTHETIC',100*COUNT(IF(RESULT_VALUE &amp;gt; 15, RESULT_VALUE))/COUNT(TEST_ID))&lt;/P&gt;&lt;P&gt;where SERVICE_INDICATOR, RESULT_VALUE and TEST_ID are the columns of my Fact Table, and I am using the above expression in the same Fact Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking everyone in anticipation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 12:27:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634922#M679072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-15T12:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634923#M679073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you using it in your data model?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 12:29:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634923#M679073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-15T12:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634924#M679074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NOCONCATENATE&lt;/P&gt;&lt;P&gt;FINAL_RESULT:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;IF(SERVICE_INDICATOR='AESTHETIC',(COUNT(IF(RESULT_VALUE &amp;gt;15, RESULT_VALUE)))/(COUNT(TEST_ID))) AS AESTHETIC_SERVICE_INDICATOR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESIDENT RESULT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 12:41:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634924#M679074</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-15T12:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634925#M679075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, first of alla if you put in the script you have to do an AS to equal to a value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to put this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(SERVICE_INDICATOR='AESTHETIC',100*COUNT(RESULT_VALUE) &amp;gt; 15, RESULT_VALUE)/COUNT(TEST_ID) as newfield,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good luck &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 12:43:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634925#M679075</guid>
      <dc:creator>fkeuroglian</dc:creator>
      <dc:date>2014-05-15T12:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634926#M679076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try including a default value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(SERVICE_INDICATOR='AESTHETIC',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100*COUNT(IF(RESULT_VALUE &amp;gt; 15, RESULT_VALUE))/COUNT(TEST_ID), 'TEST') as AESTHETIC_SERVICE_INDICATOR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 12:45:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634926#M679076</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-15T12:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634927#M679077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;COUNT() is an aggregation function that will work in UI expressions, but NOT in a simple LOAD without GROUP BY clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 12:53:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634927#M679077</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-05-15T12:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634928#M679078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have given the alias as 'AESTHETIC_INDICATOR'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 12:58:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634928#M679078</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-15T12:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634929#M679079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF I USE GROUP BY THEN I NEED TO INCLUDE ALL THE COLUMS OF THE TABLE OR THE FIELDS RELATED TO COUNT I.E SERVICE INDICATOR, RESULT VALUE AND TEST ID&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 13:00:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634929#M679079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-15T13:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634930#M679080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, almost. It's a bit more complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short: you can only include raw column names if they also appear in the GROUP BY clause. All other column names must be specified as parameters to aggregation functions like SUM(), COUNT() MAX() and the likes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, this is a valid statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD A, B, C, Max(D) AS MaximumD&lt;/P&gt;&lt;P&gt;RESIDENT SourceData&lt;/P&gt;&lt;P&gt;GROUP BY A ASC, B DESC, C;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this is not:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD A, B, C, &lt;STRONG&gt;Z&lt;/STRONG&gt;, Count(E) AS NoOfOrders&lt;/P&gt;&lt;P&gt;RESIDENT SourceData&lt;/P&gt;&lt;P&gt;GROUP BY&amp;nbsp; A ASC, B DESC, C;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, if I'm not mistaken, you cannot omit columns from your LOAD list that do appear in the GROUP BY clause, like here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD C, Sum(F) AS TotalSales&lt;/P&gt;&lt;P&gt;RESIDENT SourceData&lt;/P&gt;&lt;P&gt;GROUP BY&amp;nbsp; A ASC, B DESC, C;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't have to include all your columns if you have no need for them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW See FirstSortedValue() in QlikView Help for an escape from these annoying restrictions. It's a pretty powerful function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 13:09:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634930#M679080</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-05-15T13:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634931#M679081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Peter Thanks for the explanation, I will try and let u know if it works for me or not, also I read about the First Sorted Value function, but it was not clear to me, can u explain the same with the expression that I had mentioned in my question &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 13:29:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-Expression-Error/m-p/634931#M679081</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-15T13:29:02Z</dc:date>
    </item>
  </channel>
</rss>

