<?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: How to add unique count column on the stats result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647294#M224038</link>
    <description>&lt;LI-CODE lang="markup"&gt;| eventstats dc(buyer) as uniquebuyer by date
| stats count by date uniquebuyer product
| eval {product}=count
| fields - product count
| stats values(*) as * values(uniquebuyer) as uniquebuyer by date
| fillnull value=0&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 16 Jun 2023 13:22:47 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-06-16T13:22:47Z</dc:date>
    <item>
      <title>How to add unique count column on the stats result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647277#M224034</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have data as below&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| date | buyer | product |&lt;BR /&gt;| Jun-1 | A&amp;nbsp; &amp;nbsp; &amp;nbsp; | P-01 |&lt;BR /&gt;| Jun-1 | A&amp;nbsp; &amp;nbsp; &amp;nbsp; | P-02 |&lt;BR /&gt;| Jun-1 | B&amp;nbsp; &amp;nbsp; &amp;nbsp; | P-03 |&lt;BR /&gt;| Jun-1 | A&amp;nbsp; &amp;nbsp; &amp;nbsp; | P-03 |&lt;BR /&gt;| Jun-5 | A&amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;P-02 |&lt;BR /&gt;| Jun-5 | A&amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;P-01 |&lt;BR /&gt;| Jun-5 | A&amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;P-02 |&lt;BR /&gt;| Jun-5 | C&amp;nbsp; &amp;nbsp; &amp;nbsp; | P-02 |&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;| date&amp;nbsp; | P-01 | P-02 | P-03&amp;nbsp; | daily unique buyer |&lt;BR /&gt;|Jun-1 |&amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 |&lt;BR /&gt;|Jun-5 |&amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 |&lt;/P&gt;
&lt;P&gt;I want to stats count daily unique buyer and daily uniquer buyer by product&lt;/P&gt;
&lt;P&gt;I use&amp;nbsp; chart dc(buyer) as uuBuyer by date , product&lt;/P&gt;
&lt;P&gt;but I don't know how to do the last column I expect count the daily&amp;nbsp;unique buyer&lt;/P&gt;
&lt;P&gt;Do anyone could give me a solution?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 15:50:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647277#M224034</guid>
      <dc:creator>mia</dc:creator>
      <dc:date>2023-06-16T15:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add unique count column on the stats result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647294#M224038</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eventstats dc(buyer) as uniquebuyer by date
| stats count by date uniquebuyer product
| eval {product}=count
| fields - product count
| stats values(*) as * values(uniquebuyer) as uniquebuyer by date
| fillnull value=0&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 Jun 2023 13:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647294#M224038</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-16T13:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to add unique count column on the stats result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647321#M224044</link>
      <description>&lt;P&gt;Hi, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try your command&amp;nbsp;but the result count of&amp;nbsp; daily unique buyer by product is wrong.&lt;/P&gt;&lt;P&gt;I compare the result with&amp;nbsp;calculated separately 2&amp;nbsp;command&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;chart dc(buyer) as uniquebuyer by date, product -&amp;gt; your result not match, not unique buyer&lt;/LI&gt;&lt;LI&gt;chart dc(buyer) as uniquebuyer by date. -&amp;gt;&amp;nbsp;uniquebuyer is match&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;wrote:&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats dc(buyer) as uniquebuyer by date
| stats count by date uniquebuyer product
| eval {product}=count
| fields - product count
| stats values(*) as * values(uniquebuyer) as uniquebuyer by date
| fillnull value=0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 15:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647321#M224044</guid>
      <dc:creator>mia</dc:creator>
      <dc:date>2023-06-16T15:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to add unique count column on the stats result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647327#M224046</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I got inspire the form your command.&lt;/P&gt;&lt;P&gt;I modified and then the result is correct.&lt;/P&gt;&lt;P&gt;| eventstats dc(buyer) as uniquebuyer by date&lt;BR /&gt;| stats dc(buyer) AS uu by date product uniquebuyer&lt;BR /&gt;| eval {product}=uu&lt;BR /&gt;| fields -product uu&lt;BR /&gt;| stats values(*) as * values(uniquebuyer) as uniquebuyer by date&lt;BR /&gt;| fillnull value=0&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 15:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-unique-count-column-on-the-stats-result/m-p/647327#M224046</guid>
      <dc:creator>mia</dc:creator>
      <dc:date>2023-06-16T15:45:29Z</dc:date>
    </item>
  </channel>
</rss>

