<?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 of the max records date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1650864#M456180</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;This solution worked, but look my example.&lt;/P&gt;&lt;P&gt;When&amp;nbsp;select the ANSWER in the list, my TOTAL change.&lt;/P&gt;&lt;P&gt;Why?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2019 20:48:23 GMT</pubDate>
    <dc:creator>eloisateixeira</dc:creator>
    <dc:date>2019-11-25T20:48:23Z</dc:date>
    <item>
      <title>Count of the max records date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648163#M456173</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a table like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;MARITAL STATUS&lt;/TD&gt;&lt;TD&gt;PATIENTS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Married&lt;/TD&gt;&lt;TD&gt;196&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Widowed&lt;/TD&gt;&lt;TD&gt;75&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Single&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Divorced&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Stable Union&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;357&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to count how many ID_USERS are in each marital status, but annually&amp;nbsp;the patients are monitored and the question about marital status is asked again, so the status can change. I need an expression that count the max date record for my patient not to duplicate.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ps: i don't use the date in my dimension&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 19:36:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648163#M456173</guid>
      <dc:creator>eloisateixeira</dc:creator>
      <dc:date>2019-11-18T19:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count of the max records date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648172#M456174</link>
      <description>&lt;P&gt;Hi Eloisa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum(
	Aggr(
	If(Max(Total &amp;lt;ID_USERS&amp;gt; Date)=Date
		, 1, 0
	)
	, ID_USERS, Date
		)
	)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should be dimension agnostic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;S.T.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 20:12:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648172#M456174</guid>
      <dc:creator>Stoyan_Terziev</dc:creator>
      <dc:date>2019-11-18T20:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Count of the max records date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648177#M456175</link>
      <description>&lt;P&gt;Thank u, but this expression didn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try:&amp;nbsp;&lt;/P&gt;&lt;P&gt;COUNT(Aggr(&lt;BR /&gt;If(Max(Total &amp;lt;ID_USERS&amp;gt; DATE_WORK)=DATA_WORK&lt;BR /&gt;, 1, 0&lt;BR /&gt;)&lt;BR /&gt;, ID_USERS, DATA_WORK&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;DATE_WORK is the date that the &lt;SPAN&gt;questionnaire&amp;nbsp;&lt;/SPAN&gt;was applied&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 20:33:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648177#M456175</guid>
      <dc:creator>eloisateixeira</dc:creator>
      <dc:date>2019-11-18T20:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Count of the max records date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648180#M456176</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sure to use Sum instead of Count. Due to the particularity of the case, COUNT cannot be used.&lt;/P&gt;&lt;P&gt;I noticed the field names weren't consistent (DATA_WORK vs DATE_WORK). So here is the updated expression:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum(Aggr(
If(Max(Total &amp;lt;ID_USERS&amp;gt; DATE_WORK)=DATE_WORK
, 1, 0
)
, ID_USERS, DATE_WORK
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if that works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;S.T.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 20:45:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648180#M456176</guid>
      <dc:creator>Stoyan_Terziev</dc:creator>
      <dc:date>2019-11-18T20:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count of the max records date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648185#M456177</link>
      <description>&lt;P&gt;Didn't work. Look my dimension:&lt;/P&gt;&lt;P&gt;=if(QUESTION = 'P359 - Marital Status' ,if(WORK = '3 - P&lt;SPAN&gt;ersonal Information&lt;/SPAN&gt;', ANSWER))&lt;/P&gt;&lt;P&gt;And in expression i put your expression, but&amp;nbsp;&lt;SPAN&gt;brought the number "0".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 20:58:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648185#M456177</guid>
      <dc:creator>eloisateixeira</dc:creator>
      <dc:date>2019-11-18T20:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count of the max records date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648187#M456178</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Keep in mind the solution I propose will only work in a generic situation. You may need to customize it to your data model and specific chart properties.&lt;/P&gt;&lt;P&gt;I'd suggest you try modifying your Dimension to be simply [ANSWER] instead of this if-condition and fix the results with a set expression in the metric like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum({&amp;lt;QUESTION = {'P359 - Marital Status'}, WORK = {'3 - Personal Information'}&amp;gt;} Aggr(
If(Max(Total &amp;lt;ID_USERS&amp;gt; DATE_WORK)=DATE_WORK
, 1, 0
)
, ID_USERS, DATE_WORK
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if that works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;S.T.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 21:08:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1648187#M456178</guid>
      <dc:creator>Stoyan_Terziev</dc:creator>
      <dc:date>2019-11-18T21:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count of the max records date</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1650864#M456180</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;This solution worked, but look my example.&lt;/P&gt;&lt;P&gt;When&amp;nbsp;select the ANSWER in the list, my TOTAL change.&lt;/P&gt;&lt;P&gt;Why?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 20:48:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-the-max-records-date/m-p/1650864#M456180</guid>
      <dc:creator>eloisateixeira</dc:creator>
      <dc:date>2019-11-25T20:48:23Z</dc:date>
    </item>
  </channel>
</rss>

