<?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 Date Format issue in Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175156#M502553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alex,&lt;/P&gt;&lt;P&gt;Say you have the [Order.Add Date] with format "07-03-11" (DD-MM-YY), and that your regional settings make the Date() function to return a value like "3/7/2011" (M/D/YYYY). Thus, fields will never match, since the format is different.&lt;/P&gt;&lt;P&gt;Since you need the analysis to get working, you can compare a field itself formatted to any given value. So the expression between brackets would read "return all values for [Order.Add Date] formatted as a date with the maximum value, formatted as a date, of [Order.Receive Date]". You are not using any variable in this case, but all values from a different field, and both need some functions applied to them.&lt;/P&gt;&lt;P&gt;Another example would be counting all values in CompanyID where the first two characters of CompanyID are "ES":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Count({&amp;lt; CompanyID = {"=Left(CompanyID, 2) = 'ES'"} &amp;gt;} CompanyID)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Although this makes no sense since this does the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Count({&amp;lt; CompanyID = {"ES*"} &amp;gt;} CompanyID)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this shed some light.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Feb 2011 08:26:31 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-02-16T08:26:31Z</dc:date>
    <item>
      <title>Date Format issue in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175150#M502547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've read a number of postings related to the subtletes of date formatting in Set analysis, however, I'm unable to figure out whether what I'm trying to do is valid.&lt;/P&gt;&lt;P&gt;Is it possible to format your field in a set analysis to then compare to the expression? Essentially I have a field that contains the timestamp that I'm trying to get rid of in order to compare in rounded days, weeks, months etc. Below is an example:&lt;/P&gt;&lt;P&gt;My field [Order.Add Date] contains a timestamp that I'd like to strip off in order to compare to the max[Order.Receive Date] which does NOT have a timestamp. Is this achievable with some type of field formatting? I've used no quotes which throws a "bad field" error, single quotes which works but I believe is comparing the literal text value Date([Order.Add Date]).&lt;/P&gt;&lt;P&gt;Any suggestions would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;'Date([Order.Add Date])' ={$(=Date(Max([Order.Receive Date])))}&amp;gt;} [Order.Request Value])&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Aug 2010 23:29:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175150#M502547</guid>
      <dc:creator />
      <dc:date>2010-08-25T23:29:00Z</dc:date>
    </item>
    <item>
      <title>Date Format issue in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175151#M502548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan,&lt;/P&gt;&lt;P&gt;I would suggest formatting it in the script rather than in a set analysis expression. You can use something like the following to create a separate field that contains just the date: date(timestamp#([Order.Add Date],'MM/DD/YYYY hh:mm')) as [Order.Add Date2]. You would of course modify this to fit your timestamp format. Then in set analysis you can easily compare dates without worrying about timestamp transformations.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 02:51:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175151#M502548</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2010-08-26T02:51:55Z</dc:date>
    </item>
    <item>
      <title>Date Format issue in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175152#M502549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to do in the set analysis as opposed to the scripts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 05:42:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175152#M502549</guid>
      <dc:creator />
      <dc:date>2010-08-26T05:42:33Z</dc:date>
    </item>
    <item>
      <title>Date Format issue in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175153#M502550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My understanding is that the LHS of a set modifier expression must be a field, not an expression, so I don't think you can do it that way.&lt;/P&gt;&lt;P&gt;You could try to modify the RHS expression to match the field format of the LHS, or else do it in script as Vlad suggested.&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 06:47:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175153#M502550</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2010-08-26T06:47:35Z</dc:date>
    </item>
    <item>
      <title>Date Format issue in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175154#M502551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Although I think that Vlad's solution is better, you can actually check that on your set analysis, with something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({$&amp;lt;[Order.Add Date] =&lt;B&gt;{"=Date([Order.Add Date]) = Date(Max([Order.Receive Date]))"}&lt;/B&gt;&amp;gt;} [Order.Request Value])&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Anyway, I find this kind of cumbersome and it would be easier to add a new field in the script.&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 07:39:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175154#M502551</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-08-26T07:39:55Z</dc:date>
    </item>
    <item>
      <title>Date Format issue in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175155#M502552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;I find your last suggestion particularly intriguing (although it works, of course).&lt;/P&gt;&lt;P&gt;In your syntax, the set modifier (&amp;lt;...&amp;gt;) is matching the [Order.Add Date] field to a particular value described by:&lt;/P&gt;&lt;P&gt;{"=Date([Order.Add Date]) = Date(Max([Order.Receive Date]))"}&lt;/P&gt;&lt;P&gt;I understand that as this is enclosed in {" "}, it is performing a search for values.&lt;/P&gt;&lt;P&gt;What I don't quite understand is the way in which the [Order.Add Date] field is compared to the Max([Order.Receive Date]) within the element set {"..."}. How does this return a value that would match the 'unformatted' [Order.Add Date] field at the beginning of the set modifier?&lt;/P&gt;&lt;P&gt;I hope I've managed to get my point across, and would be most grateful if you could explain what's going on here.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;P&gt;P.S. Thanks for many helpful posts on Qlikcommunity!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 01:12:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175155#M502552</guid>
      <dc:creator />
      <dc:date>2011-02-16T01:12:20Z</dc:date>
    </item>
    <item>
      <title>Date Format issue in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175156#M502553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alex,&lt;/P&gt;&lt;P&gt;Say you have the [Order.Add Date] with format "07-03-11" (DD-MM-YY), and that your regional settings make the Date() function to return a value like "3/7/2011" (M/D/YYYY). Thus, fields will never match, since the format is different.&lt;/P&gt;&lt;P&gt;Since you need the analysis to get working, you can compare a field itself formatted to any given value. So the expression between brackets would read "return all values for [Order.Add Date] formatted as a date with the maximum value, formatted as a date, of [Order.Receive Date]". You are not using any variable in this case, but all values from a different field, and both need some functions applied to them.&lt;/P&gt;&lt;P&gt;Another example would be counting all values in CompanyID where the first two characters of CompanyID are "ES":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Count({&amp;lt; CompanyID = {"=Left(CompanyID, 2) = 'ES'"} &amp;gt;} CompanyID)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Although this makes no sense since this does the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Count({&amp;lt; CompanyID = {"ES*"} &amp;gt;} CompanyID)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this shed some light.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 08:26:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-Format-issue-in-Set-Analysis/m-p/175156#M502553</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-02-16T08:26:31Z</dc:date>
    </item>
  </channel>
</rss>

