<?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: Unable to use Max(date) in a set expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520287#M194420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Schwarz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the information, yes what you said is absolutely right, but even then im failing to get the date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'}, INCIDENT_DATE={"$(=max(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IN_INCIDENT_NO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,'MM/DD/YYYY')))"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pleae suggest if there can something else i can try so to get the required date and can move onnnn...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hassan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Sep 2013 12:00:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-09-13T12:00:38Z</dc:date>
    <item>
      <title>Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520280#M194413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can Somebody what is wron in the below set expression, im unable to use the date in the set expression, i want t get the count based on the max date, but its not giving me the intended result..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'},&lt;BR /&gt; INCIDENT_DATE={"=MAX(MakeDate(Year(INCIDENT_DATE),Month(INCIDENT_DATE),Day(INCIDENT_DATE)))"}&amp;gt;}IN_INCIDENT_NO )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when tried in a text object im getting the correct date, but the same is not working when used in a straight table expression...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hassan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 11:09:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520280#M194413</guid>
      <dc:creator />
      <dc:date>2013-09-13T11:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520281#M194414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try with a dollar sign expansion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'},&lt;/P&gt;&lt;P&gt; INCIDENT_DATE={"$(=MAX(MakeDate(Year(INCIDENT_DATE),Month(INCIDENT_DATE),Day(INCIDENT_DATE))))"}&amp;gt;}IN_INCIDENT_NO )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 11:14:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520281#M194414</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-09-13T11:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520282#M194415</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 this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;INCIDENT_DATE={"=$(=MAX(MakeDate(Year(INCIDENT_DATE),Month(INCIDENT_DATE),Day(INCIDENT_DATE))))"}&amp;gt;}IN_INCIDENT_NO )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If you are using $ then it take it as expression and then calculated. Hope it helps you&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 11:19:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520282#M194415</guid>
      <dc:creator />
      <dc:date>2013-09-13T11:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520283#M194416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AmuthaBharati,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried but its actually ignoring the date and giving me the total count, please suggest if there is any other way of getting te max of date...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hassan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 11:25:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520283#M194416</guid>
      <dc:creator />
      <dc:date>2013-09-13T11:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520284#M194417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can simplify your expression to something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max(INCIDENT_DATE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you may need to take care of the format of field INCIDENT_DATE. Assuming YYYY-MM-DD, try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'},&lt;/P&gt;&lt;P&gt; INCIDENT_DATE={"$(=Date(MAX(INCIDENT_DATE),'YYYY-MM-DD))"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 11:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520284#M194417</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-09-13T11:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520285#M194418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;seems there is some problem in the formatting not getting the value that is expected, but have tried in the text object which is giving me the max date using the below,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;max&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;INCIDENT_DATE_DISPLAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'DD/MM/YYYY')) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;but when used in the set expression it doenst seems to be working, any advise..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Hassan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 11:38:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520285#M194418</guid>
      <dc:creator />
      <dc:date>2013-09-13T11:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520286#M194419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is just wrong format of the date value. Inside a set expression, like it or not, the format must be exactly as in the field. A IF comparision is more tolerant, it would consider 41530='2013-09-13' as true. Unlike in set expression. So tell me your date or date/time format of the field INCIDENT_DATE, then I can tell you how the set expression should read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'},&lt;/P&gt;&lt;P&gt;INCIDENT_DATE={"=MAX(MakeDate(Year(INCIDENT_DATE),Month(INCIDENT_DATE),Day(INCIDENT_DATE)))"}&amp;gt;}IN_INCIDENT_NO )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your above expression has 3 issues already:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;"=MAX ..." will not calculate anything but consider this a text constant, put "$(=MAX( ....))" instead&lt;/LI&gt;&lt;LI&gt;Max, as a resutl, will return a number value, irrespective from whether the field inside the Max(..) statement was a date. See my opening words why this is unfortunate here&lt;/LI&gt;&lt;LI&gt;You seem to have tried to make the result of MAX a date by putting a MAKEDATE inside. Even when Makedate would be a formatting function (which it is not), it would only have helped, when had put it outside of the MAX(...) function. However, MakeDate does not format a date, it ironically returns an integer number instead (!). Something like 41530. Use "Date()" instead, which is a formatting function, that has a DUAL datatype as result, where the visible text is the date according to your "DateFormat"" variable and the number is an integer like 41530.&amp;nbsp; &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this and I think it will shoot&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'}, INCIDENT_DATE={"$(=Date(MAX(INCIDENT_DATE)))"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all the best&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 11:48:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520286#M194419</guid>
      <dc:creator>ChristofSchwarz</dc:creator>
      <dc:date>2013-09-13T11:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520287#M194420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Schwarz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the information, yes what you said is absolutely right, but even then im failing to get the date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'}, INCIDENT_DATE={"$(=max(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IN_INCIDENT_NO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,'MM/DD/YYYY')))"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pleae suggest if there can something else i can try so to get the required date and can move onnnn...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hassan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 12:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520287#M194420</guid>
      <dc:creator />
      <dc:date>2013-09-13T12:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520288#M194421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;also adding to the above the INCIDENT_DATE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format is as mentioned below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20130515193956&lt;/P&gt;&lt;P&gt;yyyymmddhhmmss&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and im expecting the result to be in MM/DD/YYYY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please advise...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 12:04:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520288#M194421</guid>
      <dc:creator />
      <dc:date>2013-09-13T12:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520289#M194422</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 store it in variables and then use&lt;/P&gt;&lt;P&gt;vDate=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;MakeDate(Year(INCIDENT_DATE),Month(INCIDENT_DATE),Day(INCIDENT_DATE)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;vMaxDate=Max(vDate);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are select directly as&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;vMaxDate=Max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;INCIDENT_DATE&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;and use those variables in the expression&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 12:09:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520289#M194422</guid>
      <dc:creator />
      <dc:date>2013-09-13T12:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520290#M194423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So your field format does not match the set analysis field modifier format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'},&lt;/P&gt;&lt;P&gt; INCIDENT_DATE={"$(=Date(MAX(INCIDENT_DATE),'YYYYMMDDhhmmss))"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you want to test against the date only, you should use a date field instead of a timestamp.&lt;/P&gt;&lt;P&gt;If you don't have one and you can't create one, try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'},&lt;/P&gt;&lt;P&gt; INCIDENT_DATE={"&amp;gt;=$(=daystart(MAX(INCIDENT_DATE)))"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 12:11:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520290#M194423</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-09-13T12:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520291#M194424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To narrow down the problem, approach it in 2 steps:&lt;/P&gt;&lt;P&gt;1.) Verify that your set expression works by using a text constant for the date. Try it like&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'}, INCIDENT_DATE={"&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;20130515193956&lt;/SPAN&gt;"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) If that pulls the right data, try to caluculate exactly that text in a separate text box first.&lt;/P&gt;&lt;P&gt;I think it is&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;DATE(max(INCIDENT_DATE), '&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: DE; mso-fareast-language: DE; mso-bidi-language: AR-SA;"&gt;YYYYMMDDhhmmss&lt;/SPAN&gt;')&lt;/STRONG&gt;&amp;nbsp; // Watch out the upper and lower characters in the formatting string !! MM is not mm !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) If this is also done, merge the two things: Move that formula from the textbox inbetween the $(=....) part of your set expression. Looking at your expression, this has another Error. Max() does not accept a formatting string. Try this, (the 2nd row is what you had tested before in the text box)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'}, INCIDENT_DATE={"$(=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;DATE(max(INCIDENT_DATE), ''&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: DE; mso-fareast-language: DE; mso-bidi-language: AR-SA;"&gt;YYYYMMDDhhmmss&lt;/SPAN&gt;')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;)"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 12:11:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520291#M194424</guid>
      <dc:creator>ChristofSchwarz</dc:creator>
      <dc:date>2013-09-13T12:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520292#M194425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it helped...thanks againnnn...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrds,&lt;/P&gt;&lt;P&gt;Hassan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 12:58:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520292#M194425</guid>
      <dc:creator />
      <dc:date>2013-09-13T12:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520293#M194426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have got the solution, thanks for your comments and advise...i have ahieved this by doing the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;REGION={'EAST','WN-EAST'}, INCIDENT_DATE={"&amp;gt;=$(=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; daystart(Max(INCIDENT_DATE)&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;)"}&amp;gt;} IN_INCIDENT_NO )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hassan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 18:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520293#M194426</guid>
      <dc:creator />
      <dc:date>2013-09-13T18:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use Max(date) in a set expression</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520294#M194427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to get the previous day count for the same...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hassan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 18:25:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-Max-date-in-a-set-expression/m-p/520294#M194427</guid>
      <dc:creator />
      <dc:date>2013-09-13T18:25:31Z</dc:date>
    </item>
  </channel>
</rss>

