<?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: Expression to Count MAX value for individual dimension value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570816#M741220</link>
    <description>&lt;P&gt;Hey, no worries. You can try&amp;nbsp;&lt;/P&gt;&lt;P&gt;count({1}Customer2)&lt;/P&gt;&lt;P&gt;as your formula as it will ignore all filter selections.&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2019 06:57:34 GMT</pubDate>
    <dc:creator>arpitkharkia</dc:creator>
    <dc:date>2019-04-18T06:57:34Z</dc:date>
    <item>
      <title>Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570223#M741212</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm struggling with a expression in a report. The raw data below is saying what product has been sold by which Customer.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;Subcategory&lt;/TD&gt;&lt;TD&gt;ProductName&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Bag&lt;/TD&gt;&lt;TD&gt;Totebag&lt;/TD&gt;&lt;TD&gt;TotebagA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Bag&lt;/TD&gt;&lt;TD&gt;Totebag&lt;/TD&gt;&lt;TD&gt;TotebagB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Shoes&lt;/TD&gt;&lt;TD&gt;Heels&lt;/TD&gt;&lt;TD&gt;HeelsA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;Shoes&lt;/TD&gt;&lt;TD&gt;Heels&lt;/TD&gt;&lt;TD&gt;HeelsA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;Shoes&lt;/TD&gt;&lt;TD&gt;Heels&lt;/TD&gt;&lt;TD&gt;HeelsA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;Bag&lt;/TD&gt;&lt;TD&gt;Totebag&lt;/TD&gt;&lt;TD&gt;TotebagA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;Shoes&lt;/TD&gt;&lt;TD&gt;Heels&lt;/TD&gt;&lt;TD&gt;HeelsA&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a chart using 'Category' as dimension and show the MAX number of customer base on the highest number of purchase per category (Example, if 1 customer purchased 2 shoes and 1 bag, this customer should fall into Shoes category and should NOT show in Bag category. ).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example, I would like to get the expected result as below.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;Number of customer&lt;/TD&gt;&lt;TD&gt;Remarks&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bag&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Customer A, because customer A purchased 2 Bags.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Shoes&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Customer B and C,&lt;/P&gt;&lt;P&gt;because customer B purchased 2 Shoes and customer C purchased 1 Shoes only&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I been trying with below expression but the result is negative &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;COUNT({&amp;lt;Category= {"$(=FirstSortedValue(DISTINCT Category,&lt;BR /&gt;-Aggr(Count(Customer), Category)))"}&amp;gt;} Customer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MAX(Aggr(COUNT(ProductName),&lt;BR /&gt;Category,Customer))&lt;/P&gt;&lt;P&gt;Looking forward to your helps and thank you in advance! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:50:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570223#M741212</guid>
      <dc:creator>jerfwork</dc:creator>
      <dc:date>2024-11-16T03:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570253#M741213</link>
      <description>&lt;P&gt;First row second table, shouldn't there be&lt;BR /&gt;BAG - 2&lt;BR /&gt;Because customer A und B bought a bag?&lt;BR /&gt;if yes, have a look at the following...&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 06:11:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570253#M741213</guid>
      <dc:creator>gf</dc:creator>
      <dc:date>2019-04-17T06:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570257#M741214</link>
      <description>&lt;P&gt;Hello Gf,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your replied.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The bag shouldn't be 2 because Customer B purchased Shoes more than Bags. Customer B should fall into "Shoes" category.&lt;/P&gt;&lt;P&gt;The expected result is to getting total number of unique customer. Meanwhile, the total number of "&lt;SPAN&gt;Number of customer" should not more than 3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 06:18:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570257#M741214</guid>
      <dc:creator>jerfwork</dc:creator>
      <dc:date>2019-04-17T06:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570361#M741215</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Sorry it's taken so long.&lt;BR /&gt;I updated my solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 09:00:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570361#M741215</guid>
      <dc:creator>gf</dc:creator>
      <dc:date>2019-04-17T09:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570380#M741216</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution provided works fine. I also worked on the problem.&amp;nbsp; I used FSV, please find attachment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regdars,&lt;/P&gt;&lt;P&gt;Arpit&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 09:19:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570380#M741216</guid>
      <dc:creator>arpitkharkia</dc:creator>
      <dc:date>2019-04-17T09:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570391#M741217</link>
      <description>&lt;P&gt;Hi Gf,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is working and I'm getting unique number of customer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, while I verifying the info between the result and raw info, some customer fall into correct category but there are also some customer fall into wrong category.&amp;nbsp; (I added 1 more column(Customer) into dimension to do verification)&lt;/P&gt;&lt;P&gt;Please refer attached..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 566px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/10399i3FD5BD70DBDC888A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 09:35:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570391#M741217</guid>
      <dc:creator>jerfwork</dc:creator>
      <dc:date>2019-04-17T09:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570411#M741218</link>
      <description>&lt;P&gt;Hey, can you try my solution?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 10:13:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570411#M741218</guid>
      <dc:creator>arpitkharkia</dc:creator>
      <dc:date>2019-04-17T10:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570755#M741219</link>
      <description>&lt;P&gt;Hi Arpit,&lt;/P&gt;&lt;P&gt;Sorry i have overlooked the message yesterday.&lt;/P&gt;&lt;P&gt;I have tried with the solution. However it only work if there is a fixed dataset.&lt;/P&gt;&lt;P&gt;If I do some filter/selection in the report, the number not be correct.&lt;/P&gt;&lt;P&gt;Thanks again for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 00:53:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570755#M741219</guid>
      <dc:creator>jerfwork</dc:creator>
      <dc:date>2019-04-18T00:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570816#M741220</link>
      <description>&lt;P&gt;Hey, no worries. You can try&amp;nbsp;&lt;/P&gt;&lt;P&gt;count({1}Customer2)&lt;/P&gt;&lt;P&gt;as your formula as it will ignore all filter selections.&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 06:57:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570816#M741220</guid>
      <dc:creator>arpitkharkia</dc:creator>
      <dc:date>2019-04-18T06:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570820#M741221</link>
      <description>&lt;P&gt;Hello Arpit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologized if i didn't mention clearly in my initial message. Filter/Selection will be available in the report as the user need to view different year/month/week. .&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 07:00:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570820#M741221</guid>
      <dc:creator>jerfwork</dc:creator>
      <dc:date>2019-04-18T07:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570821#M741222</link>
      <description>&lt;P&gt;Oh, ok. Can you share some samples explaining the issue? A qvw or an excel. That may help us more.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 07:03:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570821#M741222</guid>
      <dc:creator>arpitkharkia</dc:creator>
      <dc:date>2019-04-18T07:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570858#M741223</link>
      <description>&lt;P&gt;Hello Arpit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently i'm using "Category" as my dimension. For the expression, i'm using the solution that provided by Gf.&lt;/P&gt;&lt;P&gt;COUNT(AGGr(max(aggr(count(Category), Customer)),Customer))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result is fantastic in the testing qvw file. However, when i put this expression into my real report (With more raw data info). The number seem hay-wired.&amp;nbsp;I added "Customer" as my second dimension in order to verify the result, but I realized it is randomly grab Category instead of my expectation (Base on purchased the most of the category).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see below screenshot for more understanding. Based on the screenshot below, the Category should show "Bags" instead of "Shoes". but i have no idea why it is showing "Shoes".&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 566px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/10483iB0FD72F84679D42E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 08:25:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570858#M741223</guid>
      <dc:creator>jerfwork</dc:creator>
      <dc:date>2019-04-18T08:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570963#M741224</link>
      <description>&lt;P&gt;I have not seen what others have provided... but this seems to be working&lt;/P&gt;&lt;PRE&gt;Count(Aggr(If(Count(Category) = Max(TOTAL &amp;lt;Customer&amp;gt; Aggr(Count(Category), Customer, Category)), Category), Customer, Category))&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 11:12:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1570963#M741224</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-18T11:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1571500#M741225</link>
      <description>&lt;P&gt;Thank you Sunny! Your solution is working fine for me ! The information look correct.&lt;/P&gt;&lt;P&gt;May I ask if it is possible to add a condition into the expression? Because there is a situation like a Customer purchase 1 Bag and 1 Shoes. Using the solution that you provided, this customer will count as 2 instead of 1. Is it possible to get the latest purchase? Please see below reference.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 980px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/10614i275CC4192446FF85/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Sat, 20 Apr 2019 13:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1571500#M741225</guid>
      <dc:creator>jerfwork</dc:creator>
      <dc:date>2019-04-20T13:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1572042#M741226</link>
      <description>&lt;P&gt;Here you are&lt;/P&gt;&lt;PRE&gt;Count(Aggr(If(
	(Max(TOTAL &amp;lt;Customer&amp;gt; Aggr(Count(Category), Customer, Category)) &amp;lt;&amp;gt; Min(TOTAL &amp;lt;Customer&amp;gt; Aggr(Count(Category), Customer, Category)) and Count(Category) = Max(TOTAL &amp;lt;Customer&amp;gt; Aggr(Count(Category), Customer, Category))) or
	(Max(TOTAL &amp;lt;Customer&amp;gt; Aggr(Count(Category), Customer, Category)) = Min(TOTAL &amp;lt;Customer&amp;gt; Aggr(Count(Category), Customer, Category)) and Category = FirstSortedValue(TOTAL &amp;lt;Customer&amp;gt; Category, -Date))
, Category), Customer, Category))&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Apr 2019 11:40:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1572042#M741226</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-23T11:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to Count MAX value for individual dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1572368#M741227</link>
      <description>Thank you Sunny! It's solved! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 24 Apr 2019 01:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-Count-MAX-value-for-individual-dimension-value/m-p/1572368#M741227</guid>
      <dc:creator>jerfwork</dc:creator>
      <dc:date>2019-04-24T01:17:21Z</dc:date>
    </item>
  </channel>
</rss>

