<?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 problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776888#M663235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried! There is always the same error! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Jan 2015 22:12:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-12T22:12:38Z</dc:date>
    <item>
      <title>Invalid expression problem</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776886#M663233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I'm trying to calculate the CC returns from my script. This is the part of the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AZIONI_3:&lt;/P&gt;&lt;P&gt;NoConcatenate load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;if (Azione=peek(Azione,-1), peek([Adj Close],-1),'-') as Val_close_prec&lt;/P&gt;&lt;P&gt;resident AZIONI_2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table AZIONI_2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CC:&lt;/P&gt;&lt;P&gt;NoConcatenate load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;-log((Avg(Val_close_prec)))+log(Avg([Adj Close])) as CC&lt;/P&gt;&lt;P&gt;Resident AZIONI_3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i run it it shows this error: &lt;/P&gt;&lt;P&gt;Invalid expression&lt;/P&gt;&lt;P&gt;CC:&lt;/P&gt;&lt;P&gt;NoConcatenate LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;-log((Avg(Val_close_prec)))+log(Avg([Adj Close])) as CC&lt;/P&gt;&lt;P&gt;Resident AZIONI_3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand where the problem is! When i use that formula as expression in a pivot table it works...&lt;/P&gt;&lt;P&gt;Can somebody explain the error to me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 21:55:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776886#M663233</guid>
      <dc:creator />
      <dc:date>2015-01-12T21:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression problem</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776887#M663234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well for one if you are using avg you will need a group by in your load statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident AZIONI_3&lt;/P&gt;&lt;P&gt;Group by (all the fields included in the *)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 22:04:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776887#M663234</guid>
      <dc:creator>jpapador</dc:creator>
      <dc:date>2015-01-12T22:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression problem</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776888#M663235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried! There is always the same error! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 22:12:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776888#M663235</guid>
      <dc:creator />
      <dc:date>2015-01-12T22:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression problem</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776889#M663236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure you can do a -log in the script.&amp;nbsp; Is it possible to do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;log(Avg(Val_close_prec))*-1 + log(Avg([Adj Close]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you have 2 parenthesis after the first log and not the second... That might be intended tho&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 22:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776889#M663236</guid>
      <dc:creator>jpapador</dc:creator>
      <dc:date>2015-01-12T22:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression problem</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776890#M663237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post the script you tried.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run this script as is. You will get invalid expr error and also run it with Group by after removing ; and comment&lt;/P&gt;&lt;P&gt;Load Prod,Log(Avg(Sales)); // Group By Prod;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Prod,Year,Sales&lt;/P&gt;&lt;P&gt;p1,2014,100&lt;/P&gt;&lt;P&gt;p1,2015,50&lt;/P&gt;&lt;P&gt;p2,2014,1000&lt;/P&gt;&lt;P&gt;p2,2015,500 ];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 06:06:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776890#M663237</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-01-13T06:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression problem</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776891#M663238</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;If you use any aggregation functions (Avg() in your case) in a LOAD statement, all other fields need to be listed in a Group By statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;CC:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;NoConcatenate load&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;*,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;-log((Avg(Val_close_prec)))+log(Avg([Adj Close])) as CC&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident AZIONI_3&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Group By&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a, &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;All the fields returned by the * must be explicitly stated under the Group By clause. (a, b, ... should be replaced by the fields in AZIONI_3).&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HTH&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 06:16:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776891#M663238</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-01-13T06:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression problem</title>
      <link>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776892#M663239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes you were right.. I forgot to add the key in the group by.. Now it works! Thanks to all!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 09:12:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Invalid-expression-problem/m-p/776892#M663239</guid>
      <dc:creator />
      <dc:date>2015-01-13T09:12:16Z</dc:date>
    </item>
  </channel>
</rss>

