<?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: Min Function not working with Date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078502#M923520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;maahivee wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Yes have tried multiple ways.. Like with Min(Num(Date))..&lt;/P&gt;
&lt;P&gt;But when loading the date i a doing it like this - Date(Floor(Date))&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ok, but can you confirm that your dates have a numeric representation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you get numbers when you are creating a table chart with dimension Date and expression =Num(Date)&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Apr 2016 21:07:34 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-04-07T21:07:34Z</dc:date>
    <item>
      <title>Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078495#M923513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guys , I Have a small issue in my dashboard.. In the straight table I am trying to add &lt;STRONG&gt;Min&lt;/STRONG&gt; function for Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is like this.. Each order may have multiple invoices. I am trying to show the 1st invoice for each order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i am trying to give the calculated dimension like this -&lt;STRONG&gt; If( Date = Min(Date) , Date)&lt;/STRONG&gt;. Also giving &lt;STRONG&gt;"Suppress when value is null"&lt;/STRONG&gt; for that particular dimension.&lt;/P&gt;&lt;P&gt;So, the date here is the invoice date, So when I use the above statement I would expect it to show only the 1st invoice for every order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But instead it is just giving "error in calculated dimension".. Can you guys please help me here..&lt;/P&gt;&lt;P&gt;This one is so simple and yet so stressful by not working..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help here is highly appreciated.. Thank You. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078495#M923513</guid>
      <dc:creator>maahivee</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078496#M923514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;If(Date = Min(&lt;SPAN style="color: #ff0000;"&gt;TOTAL&lt;/SPAN&gt; Date) , Date)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 19:05:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078496#M923514</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-07T19:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078497#M923515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply.. But its giving out null all thru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 20:11:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078497#M923515</guid>
      <dc:creator>maahivee</dc:creator>
      <dc:date>2016-04-07T20:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078498#M923516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is your DATE field correctly loaded as a dual field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you put a list box on your DATE field are the values left justified indicating they are text, or right justified indicating a dual field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Min() returns&amp;nbsp; the numeric minimum and should be used on date fields. Minstring() should be used on text data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This blog has more details on dates in Qlikview. &lt;A href="https://community.qlik.com/qlik-blogpost/2622"&gt;Get the Dates Right&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 20:11:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078498#M923516</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2016-04-07T20:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078499#M923517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess you would then need to check if you date is actually read as date by QlikView or not -&amp;gt; &lt;A href="https://community.qlik.com/qlik-blogpost/2954"&gt;Why don’t my dates work?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 20:14:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078499#M923517</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-07T20:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078500#M923518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes have tried multiple ways.. Like with Min(Num(Date)).. &lt;/P&gt;&lt;P&gt;But when loading the date i a doing it like this - Date(Floor(Date))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 21:01:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078500#M923518</guid>
      <dc:creator>maahivee</dc:creator>
      <dc:date>2016-04-07T21:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078501#M923519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be give this a shot:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(Only({1&amp;lt;Date = {'$(=Date(Min(Date)))'}&amp;gt;} Date), Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 21:03:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078501#M923519</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-07T21:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078502#M923520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;maahivee wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Yes have tried multiple ways.. Like with Min(Num(Date))..&lt;/P&gt;
&lt;P&gt;But when loading the date i a doing it like this - Date(Floor(Date))&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ok, but can you confirm that your dates have a numeric representation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you get numbers when you are creating a table chart with dimension Date and expression =Num(Date)&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 21:07:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078502#M923520</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-07T21:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078503#M923521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I missed that you are using multiple dimensions, Order and Invoice:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Aggr( If( Date = &lt;STRONG&gt;Min(TOTAL&amp;lt;Order&amp;gt; Date)&lt;/STRONG&gt;, Date), Order, Date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 21:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078503#M923521</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-07T21:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078504#M923522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all guys for all your time and effort.. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 00:37:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078504#M923522</guid>
      <dc:creator>maahivee</dc:creator>
      <dc:date>2016-04-08T00:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Min Function not working with Date</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078505#M923523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maahivee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an alternative approach to your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than use the chart to calculate the first invoice number, which incurs a memory overhead as the chart is calculated, you could instead calculate which is the first invoice for each order in the script.&amp;nbsp; This would allow you to use a list box to select just the first invoice from each order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The invoice numbers must be numeric for the min function to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an example, here is some sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;recID,orderNumber,invoiceNumber,invoiceDate,orderValue&lt;/P&gt;&lt;P&gt;1,1,1,01/02/2016,56&lt;/P&gt;&lt;P&gt;2,1,2,03/02/2016,120&lt;/P&gt;&lt;P&gt;3,1,3,08/02/2016,126&lt;/P&gt;&lt;P&gt;4,2,1,02/02/2016,26&lt;/P&gt;&lt;P&gt;5,2,2,02/02/2016,56&lt;/P&gt;&lt;P&gt;6,2,3,02/03/2016,34&lt;/P&gt;&lt;P&gt;7,2,4,02/04/2016,78&lt;/P&gt;&lt;P&gt;8,2,5,02/05/2016,234&lt;/P&gt;&lt;P&gt;9,3,1,02/04/2016,879&lt;/P&gt;&lt;P&gt;10,3,2,12/03/2016,45&lt;/P&gt;&lt;P&gt;11,3,3,02/04/2016,123&lt;/P&gt;&lt;P&gt;12,3,4,08/04/2016,2436&lt;/P&gt;&lt;P&gt;13,3,5,10/04/2016,67&lt;/P&gt;&lt;P&gt;14,3,6,12/04/2016,87&lt;/P&gt;&lt;P&gt;15,3,7,16/04/2016,345&lt;/P&gt;&lt;P&gt;16,4,1,07/06/2016,978&lt;/P&gt;&lt;P&gt;17,4,2,02/07/2016,23&lt;/P&gt;&lt;P&gt;18,4,3,16/08/2016,56&lt;/P&gt;&lt;P&gt;19,4,4,05/09/2016,42&lt;/P&gt;&lt;P&gt;20,4,5,02/10/2016,234&lt;/P&gt;&lt;P&gt;21,4,6/12/2016,978&lt;/P&gt;&lt;P&gt;22,4,7/12/2016,2665];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join (Data)&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;orderNumber&lt;/P&gt;&lt;P&gt;,min(invoiceNumber) as firstinvoice&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Group By orderNumber&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join (Data)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;recID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;,If(invoiceNumber=firstinvoice,'First',) as firstInvoiceIndicator&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have loaded the data create a straight table with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimensions&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;orderNumber&lt;/LI&gt;&lt;LI&gt;invoiceNumber&lt;/LI&gt;&lt;LI&gt;invoiceDate&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sum(orderValue)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then add a list box and choose the &lt;SPAN style="font-size: 13.3333px;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;firstInvoiceIndicator' dimension..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What this does is to firstly identify the first invoice for each order then flag this invoice number record in a new dimension.&amp;nbsp; By adding the '&lt;SPAN style="font-size: 13.3333px;"&gt;firstInvoiceIndicator' dimension to a listbox you will be able to select the value of 'First' to instantly filter your records to just the first invoice for each order or release the filter to see them all, effectively creating a toggle option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you only ever want to see the first invoices you could then either not load the data you don't need, or use the &lt;SPAN style="font-size: 13.3333px;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;firstInvoiceIndicator' dimension in a calculated dimension&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;e.g.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Once you have loaded the data create a straight table with:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Dimensions&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;=If(firstInvoiceIndicator='First',orderNumber,) &lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;And tick Suppress When Value Is Null&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;invoiceNumber&lt;/LI&gt;&lt;LI&gt;invoiceDate&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Expression&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sum(orderValue)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hope that helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Kind regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Steve&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 00:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Function-not-working-with-Date/m-p/1078505#M923523</guid>
      <dc:creator />
      <dc:date>2016-04-08T00:38:29Z</dc:date>
    </item>
  </channel>
</rss>

