<?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 Based on Max Week Ending Date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626904#M446165</link>
    <description>&lt;P&gt;I suppose you need to count distinct products. Date is ok, set analysis is ok&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2019 13:08:34 GMT</pubDate>
    <dc:creator>DavidM</dc:creator>
    <dc:date>2019-09-23T13:08:34Z</dc:date>
    <item>
      <title>Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626808#M446155</link>
      <description>&lt;P&gt;Hi, I am new to the world of Qlik and I am trying to develop a dashboard with a few measures. The first measure that I would like is to display a count of a column based on the max week ending date. The following is an example of the data (based on an sql query that I have)&lt;/P&gt;&lt;P&gt;we_date | count(*)&lt;/P&gt;&lt;P&gt;2019-09-06 | 914&lt;BR /&gt;2019-09-13 | 416&lt;/P&gt;&lt;P&gt;I then wrote the following expression:&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Date={$(= max (we_date))}&amp;gt;}product_name)&lt;/P&gt;&lt;P&gt;but this displays a total of 1330 which is a sum of 914+416 so not sure where I am going wrong.&lt;/P&gt;&lt;P&gt;I would appreciate it if somebody could advise on how I could fix this.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 09:55:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626808#M446155</guid>
      <dc:creator>aftabn10</dc:creator>
      <dc:date>2019-09-23T09:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626839#M446157</link>
      <description>&lt;P&gt;I think you're missing quoutes:&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Date={&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;/FONT&gt;$(= max (we_date))&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;/FONT&gt;}&amp;gt;}product_name)&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:29:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626839#M446157</guid>
      <dc:creator>DavidM</dc:creator>
      <dc:date>2019-09-23T11:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626847#M446158</link>
      <description>&lt;P&gt;Hi DavidM thanks for your response. Unfortunately adding the quotes made no difference. I am starting to think if this has anything to do with the data type of the we_date column as I just don't get why the max element isn't being picked up.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:44:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626847#M446158</guid>
      <dc:creator>aftabn10</dc:creator>
      <dc:date>2019-09-23T11:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626852#M446160</link>
      <description>&lt;P&gt;Then you need to check if your field is in $timestamp $date format - you can see that in data model for example (if not use Date# function). Also you could try assigning Max value to variable and check if that variable gets right value.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:47:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626852#M446160</guid>
      <dc:creator>DavidM</dc:creator>
      <dc:date>2019-09-23T11:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626884#M446162</link>
      <description>&lt;P&gt;Hi DavidM, I have checked we_date under Data Model viewer and within Tags I can see $numeric $integer $timestamp $date&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 12:26:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626884#M446162</guid>
      <dc:creator>aftabn10</dc:creator>
      <dc:date>2019-09-23T12:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626886#M446163</link>
      <description>&lt;P&gt;This is strange, also your count is showing sum. If you add column Max(we_date) to table what do you see?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 12:27:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626886#M446163</guid>
      <dc:creator>DavidM</dc:creator>
      <dc:date>2019-09-23T12:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626887#M446164</link>
      <description>&lt;P&gt;When I add Max(we_date) it shows me the date 13/09/2019 after I change the Number formatting to Date.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 12:31:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626887#M446164</guid>
      <dc:creator>aftabn10</dc:creator>
      <dc:date>2019-09-23T12:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626904#M446165</link>
      <description>&lt;P&gt;I suppose you need to count distinct products. Date is ok, set analysis is ok&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:08:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1626904#M446165</guid>
      <dc:creator>DavidM</dc:creator>
      <dc:date>2019-09-23T13:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627436#M446200</link>
      <description>&lt;P&gt;Hi DavidM, quick update. I managed to write the following definition in a variable vTotalOrders:&lt;/P&gt;&lt;P&gt;COUNT({&amp;lt;we_date_num = {"43721"}&amp;gt;}product_name)&lt;/P&gt;&lt;P&gt;and this gives me the numbers that I require, although I am still having an issue applying a max to the date as when I add that it changes all the results to 0.&lt;/P&gt;&lt;P&gt;I also added another variable vWeekEndingMax with the definition Max(we_date_num) and when I add this to the dashboard it displays the date fine so this works but when I change the above definition to:&lt;/P&gt;&lt;P&gt;COUNT({&amp;lt;we_date_num = vWeekEndingMax&amp;gt;}product_name)&lt;/P&gt;&lt;P&gt;then this changes it all to 0 again.&lt;/P&gt;&lt;P&gt;Btw we_date_num is an additional column I added into my table with the datatype int within the sql query I wrote. The reason for this was because I thought with the date value it might still be seeing as text/string hence it wasn't working.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 12:51:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627436#M446200</guid>
      <dc:creator>aftabn10</dc:creator>
      <dc:date>2019-09-24T12:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627476#M446206</link>
      <description>&lt;P&gt;check if this works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;COUNT({&amp;lt;we_date_num = {"$(vWeekEndingMax)"}&amp;gt;}product_name)&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 13:39:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627476#M446206</guid>
      <dc:creator>qlik_venu</dc:creator>
      <dc:date>2019-09-24T13:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627481#M446207</link>
      <description>&lt;P&gt;Thanks for your reply Qlik_venu, unfortunately tried that but still the same.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 13:43:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627481#M446207</guid>
      <dc:creator>aftabn10</dc:creator>
      <dc:date>2019-09-24T13:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627500#M446209</link>
      <description>&lt;P&gt;Hi, I have managed to solve the issue yay!&lt;/P&gt;&lt;P&gt;I changed to code to:&lt;BR /&gt;&lt;BR /&gt;=Count( {$&amp;lt;we_date_num = {$(vWeekEndingMax)} &amp;gt;} product_name )&lt;/P&gt;&lt;P&gt;It was a case of adding an equal sign before count but this still showed as 0 but when I added an equal sign to my other variable vWeekEndingMax&lt;/P&gt;&lt;P&gt;=Max(we_date_num) then this started working&lt;/P&gt;&lt;P&gt;I would love to know what I should be using as I have been looking through the forums and seen so many examples without the equal sign so would love an explanation.&lt;/P&gt;&lt;P&gt;Thank you all for your help&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 14:01:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627500#M446209</guid>
      <dc:creator>aftabn10</dc:creator>
      <dc:date>2019-09-24T14:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count Based on Max Week Ending Date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627542#M446211</link>
      <description>&lt;P&gt;Have you tried single quotes rather than double quotes?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({$&amp;lt;Date={&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;$(= max (we_date))&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;}&amp;gt;}product_name)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And, make sure both fields are formatted the same.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 14:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Based-on-Max-Week-Ending-Date/m-p/1627542#M446211</guid>
      <dc:creator>johnca</dc:creator>
      <dc:date>2019-09-24T14:50:47Z</dc:date>
    </item>
  </channel>
</rss>

