<?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 Group by &amp;gt; invalid expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834876#M656682</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 am trying to get the maximum value per category, but somehow I cannot get my script working. I refered to this post: &lt;A href="https://community.qlik.com/thread/52548"&gt;Max Group By 2 fields&lt;/A&gt;. The solution that is posted there should work for my case as well, but I get an invalid expression error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I load a table that has all file names in a certain folder and their respective creation dates (which I extracted from the file names). Every report in the folder belongs to a certain category. This category can be derived from the last bit of the file name. I want to create a field that gives the maximum date per category. I used the following script, but that thus leads to the invalid expression error. Does anyone have a clue what might be the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set NullInterpret = '';&lt;/P&gt;&lt;P&gt;SET ThousandSep='.';&lt;/P&gt;&lt;P&gt;SET DecimalSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyThousandSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyDecimalSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyFormat='€ #.##0,00;€ -#.##0,00';&lt;/P&gt;&lt;P&gt;SET TimeFormat='h:mm:ss';&lt;/P&gt;&lt;P&gt;SET DateFormat='MM-DD-YYYY';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='D-M-YYYY h:mm:ss[.fff]';&lt;/P&gt;&lt;P&gt;SET MonthNames='jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec';&lt;/P&gt;&lt;P&gt;SET DayNames='ma;di;wo;do;vr;za;zo';&lt;/P&gt;&lt;P&gt;LET vPath = 'C:\Users\yno\Documents\Qlikview-Dashboard\';&lt;/P&gt;&lt;P&gt;LET vToday = date(today(),'DDMMYYYY');&lt;/P&gt;&lt;P&gt;LET vinputPositions = 'OTC-Posities';&lt;/P&gt;&lt;P&gt;LET vinputDTCCFX = 'DTCCFX';&lt;/P&gt;&lt;P&gt;LET vinputDTCCRATES = 'DTCCRATES';&lt;/P&gt;&lt;P&gt;LET vinputDTCCCOMMODITIES = 'DTCCCOMMODITIES';&lt;/P&gt;&lt;P&gt;LET vinputDTCCCREDIT='DTCCCREDIT';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;FileName() as name,&lt;/P&gt;&lt;P&gt;date(Mid(Filename(),findoneof(Filename(),'-')+1,10),'MM-DD-YYYY') as date,&lt;/P&gt;&lt;P&gt;right(Filename(),7) as category&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from $(vPath)*.csv;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;category,&lt;/P&gt;&lt;P&gt;name,&lt;/P&gt;&lt;P&gt;max(date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resident table1 group by category order by date;&lt;/P&gt;&lt;P&gt;drop table table1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jun 2015 09:47:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-06-05T09:47:34Z</dc:date>
    <item>
      <title>Group by &gt; invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834876#M656682</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 am trying to get the maximum value per category, but somehow I cannot get my script working. I refered to this post: &lt;A href="https://community.qlik.com/thread/52548"&gt;Max Group By 2 fields&lt;/A&gt;. The solution that is posted there should work for my case as well, but I get an invalid expression error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I load a table that has all file names in a certain folder and their respective creation dates (which I extracted from the file names). Every report in the folder belongs to a certain category. This category can be derived from the last bit of the file name. I want to create a field that gives the maximum date per category. I used the following script, but that thus leads to the invalid expression error. Does anyone have a clue what might be the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set NullInterpret = '';&lt;/P&gt;&lt;P&gt;SET ThousandSep='.';&lt;/P&gt;&lt;P&gt;SET DecimalSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyThousandSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyDecimalSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyFormat='€ #.##0,00;€ -#.##0,00';&lt;/P&gt;&lt;P&gt;SET TimeFormat='h:mm:ss';&lt;/P&gt;&lt;P&gt;SET DateFormat='MM-DD-YYYY';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='D-M-YYYY h:mm:ss[.fff]';&lt;/P&gt;&lt;P&gt;SET MonthNames='jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec';&lt;/P&gt;&lt;P&gt;SET DayNames='ma;di;wo;do;vr;za;zo';&lt;/P&gt;&lt;P&gt;LET vPath = 'C:\Users\yno\Documents\Qlikview-Dashboard\';&lt;/P&gt;&lt;P&gt;LET vToday = date(today(),'DDMMYYYY');&lt;/P&gt;&lt;P&gt;LET vinputPositions = 'OTC-Posities';&lt;/P&gt;&lt;P&gt;LET vinputDTCCFX = 'DTCCFX';&lt;/P&gt;&lt;P&gt;LET vinputDTCCRATES = 'DTCCRATES';&lt;/P&gt;&lt;P&gt;LET vinputDTCCCOMMODITIES = 'DTCCCOMMODITIES';&lt;/P&gt;&lt;P&gt;LET vinputDTCCCREDIT='DTCCCREDIT';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;FileName() as name,&lt;/P&gt;&lt;P&gt;date(Mid(Filename(),findoneof(Filename(),'-')+1,10),'MM-DD-YYYY') as date,&lt;/P&gt;&lt;P&gt;right(Filename(),7) as category&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from $(vPath)*.csv;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;category,&lt;/P&gt;&lt;P&gt;name,&lt;/P&gt;&lt;P&gt;max(date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resident table1 group by category order by date;&lt;/P&gt;&lt;P&gt;drop table table1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 09:47:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834876#M656682</guid>
      <dc:creator />
      <dc:date>2015-06-05T09:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Group by &gt; invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834877#M656683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need the field "name" also within the group by statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 09:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834877#M656683</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-06-05T09:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Group by &gt; invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834878#M656684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martijn, you need to add all fields outside an aggregation function to the grou by clause, in this case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; category,&lt;/P&gt;&lt;P&gt;name,&lt;/P&gt;&lt;P&gt;max(date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resident table1 group by category, name order by date;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 09:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834878#M656684</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-06-05T09:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Group by &gt; invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834879#M656685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max(date) as date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 09:50:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834879#M656685</guid>
      <dc:creator>awhitfield</dc:creator>
      <dc:date>2015-06-05T09:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Group by &gt; invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834880#M656686</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;table2: &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;category,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;name,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;max(date) as date &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;resident table1 group by &lt;STRONG&gt;category, name&lt;/STRONG&gt; order by date;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 09:52:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834880#M656686</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2015-06-05T09:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Group by &gt; invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834881#M656687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you Need to Change table2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table2:&lt;/P&gt;&lt;P&gt;noconcatenate load&lt;/P&gt;&lt;P&gt;category,&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;max(date)&lt;/P&gt;&lt;P&gt;resident table1 Group by category, Name order by date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you only Need max Dates for categorys, drop the field Name &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 09:53:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834881#M656687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-05T09:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Group by &gt; invalid expression</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834882#M656688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to add name to your group by as well. All non-aggregated fields must be in a group by clause. And you cannot sort by date, because it is an aggregated field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you need to sort the output? Use this and sort the date in the front end:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;load&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt;category,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;name,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;max(date) As mDate&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;resident table1 &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;group by category, name;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2015 09:54:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-gt-invalid-expression/m-p/834882#M656688</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-06-05T09:54:03Z</dc:date>
    </item>
  </channel>
</rss>

