<?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: Count problem with date formating in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344124#M127079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I said, using &lt;SPAN style="text-decoration: underline;"&gt;your &lt;/SPAN&gt;expressions I get results 3, 1 and 2 for those three different dates. &lt;/P&gt;&lt;P&gt;Seems ok to me (with your sample data, maybe your real data differ in structure?)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Mar 2012 23:47:00 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-03-08T23:47:00Z</dc:date>
    <item>
      <title>Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344117#M127072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field (data_criacao) in a table with date format and I create a variable (DiaSelect) with the max vallue from the table field (MAX(data_criacao),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to count how many registers I have with the variable date (in this case the max valeu) but I´ll use it in a calendar to change it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do it I create a text box with the follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count( if (date(data_criacao,'DD-MM-YYYY') = date(DiaSelect,'DD-MM-YYYY'), numero_pedido)) &amp;amp; '&amp;nbsp; -&amp;nbsp; ' &amp;amp;date(DiaSelect,'DD-MM-YYYY')&amp;nbsp;&amp;nbsp; &amp;amp; '&amp;nbsp; -&amp;nbsp; '&amp;amp;max(date(data_criacao,'DD-MM-YYYY'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it returns&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; -&amp;nbsp; 27-02-2012&amp;nbsp; -&amp;nbsp; 27-02-2012&amp;nbsp;&amp;nbsp;&amp;nbsp; (in fact the base has 853 register in this condition)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tryed :&amp;nbsp; &lt;/P&gt;&lt;P&gt;=count( if (Max(date(data_criacao,'DD-MM-YYYY')) = date(DiaSelect,'DD-MM-YYYY'), numero_pedido)) &amp;amp; '&amp;nbsp; -&amp;nbsp; ' &amp;amp;date(DiaSelect,'DD-MM-YYYY')&amp;nbsp;&amp;nbsp; &amp;amp; '&amp;nbsp; -&amp;nbsp; '&amp;amp;max(date(data_criacao,'DD-MM-YYYY'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the expression is not OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can anyone help me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 20:39:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344117#M127072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-08T20:39:18Z</dc:date>
    </item>
    <item>
      <title>Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344118#M127073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, it does count '1' value for field numero_pedidio. But does this value contain 853? Then you need to use sum() or only() or maybe nothing instead of count() function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;=&lt;STRONG&gt;sum&lt;/STRONG&gt;( if (date(data_criacao,'DD-MM-YYYY') = date(DiaSelect,'DD-MM-YYYY'), numero_pedido)) &amp;amp; '&amp;nbsp; -&amp;nbsp; ' &amp;amp;date(DiaSelect,'DD-MM-YYYY')&amp;nbsp;&amp;nbsp; &amp;amp; '&amp;nbsp; -&amp;nbsp; '&amp;amp;max(date(data_criacao,'DD-MM-YYYY'))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I am totally wrong here, just assuming that your registers are already aggregated in field numero_pedido.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 20:56:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344118#M127073</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-03-08T20:56:48Z</dc:date>
    </item>
    <item>
      <title>Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344119#M127074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I´m trying is to count how many ORDERS (numero_pedido) I have for a specific date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I can not use ONLY&amp;nbsp; or SUM functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable DiaSelect brings the las order day as an initial parameter to count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is when I use the MAX funciont into the IF function in the expression bellow. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;=count( if (Max(date(data_criacao,'DD-MM-YYYY')) = date(DiaSelect,'DD-MM-YYYY'), numero_pedido)) &amp;amp; '&amp;nbsp; -&amp;nbsp; ' &amp;amp;date(DiaSelect,'DD-MM-YYYY')&amp;nbsp;&amp;nbsp; &amp;amp; '&amp;nbsp; -&amp;nbsp; '&amp;amp;max(date(data_criacao,'DD-MM-YYYY'))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 22:53:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344119#M127074</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-08T22:53:01Z</dc:date>
    </item>
    <item>
      <title>Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344120#M127075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't embed an aggregation function into another aggregation function (Max() into count() ). That's not possible.&lt;/P&gt;&lt;P&gt;You need to use advanced aggregation using aggr() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems I don't understand your setting properly. Would it be feasible that you upload a small sample, or some INLINE table data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 23:05:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344120#M127075</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-03-08T23:05:04Z</dc:date>
    </item>
    <item>
      <title>Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344121#M127076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The tabel format is simple as bellow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data_criacao&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numero_pedido&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (data_criacao means Order date and numero_pedido means order #)&lt;/P&gt;&lt;P&gt;20-12-2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1232&lt;/P&gt;&lt;P&gt;20-12-2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1238&lt;/P&gt;&lt;P&gt;20-12-2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1237&lt;/P&gt;&lt;P&gt;21-12-2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1236&lt;/P&gt;&lt;P&gt;22-12-2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1235&lt;/P&gt;&lt;P&gt;22-12-2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I create a variable DiaSelect with MAX(date(data_criacao,DD-MM-YYYY)&amp;nbsp; and in this example will have '22-12-2012' as a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will use a calendar to show the variable and a text box to show a count of order in a variable day. The count is my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 23:15:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344121#M127076</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-08T23:15:31Z</dc:date>
    </item>
    <item>
      <title>Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344122#M127077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With your above sample data and using your expressions, I get a count of 2. Seems correct to me, since you have two records for 22-12-2012.&lt;/P&gt;&lt;P&gt;Using a calendar, I can select 20-12-2012, 21-12-2012 or 22-12-2012 and I get 3,1 and 2 as counts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 23:30:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344122#M127077</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-03-08T23:30:38Z</dc:date>
    </item>
    <item>
      <title>Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344123#M127078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, but the expression comes allways with 1 as a result. It is not counting well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 23:36:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344123#M127078</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-08T23:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344124#M127079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I said, using &lt;SPAN style="text-decoration: underline;"&gt;your &lt;/SPAN&gt;expressions I get results 3, 1 and 2 for those three different dates. &lt;/P&gt;&lt;P&gt;Seems ok to me (with your sample data, maybe your real data differ in structure?)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 23:47:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344124#M127079</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-03-08T23:47:00Z</dc:date>
    </item>
    <item>
      <title>Count problem with date formating</title>
      <link>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344125#M127080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Found the problem. The field format after date (xxx,'DD-MMM-YYYY') does not cut the time after the date, so the counter will allways be one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I included a left(xxxx,10) and it worked well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 22:09:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-problem-with-date-formating/m-p/344125#M127080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-09T22:09:38Z</dc:date>
    </item>
  </channel>
</rss>

