<?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: Using Search Tutorial data, how to search for the total number of items sold, the best selling item, and number of the best selling item sold by country? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-Search-Tutorial-data-how-to-search-for-the-total-number-of/m-p/134488#M36761</link>
    <description>&lt;P&gt;This is a great example to add to the Search Tutorial. Thank you! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Nov 2014 08:32:40 GMT</pubDate>
    <dc:creator>sophy</dc:creator>
    <dc:date>2014-11-26T08:32:40Z</dc:date>
    <item>
      <title>Using Search Tutorial data, how to search for the total number of items sold, the best selling item, and number of the best selling item sold by country?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Search-Tutorial-data-how-to-search-for-the-total-number-of/m-p/134486#M36759</link>
      <description>&lt;P&gt;Hi, I'm going over the search tutorial and have a question regarding the stats command.&lt;/P&gt;

&lt;P&gt;What I'm trying to find is to find best selling item, number of best selling item sold and total number of items sold by country.&lt;/P&gt;

&lt;P&gt;I've managed to get the stats for both best selling item and total number of items sold but not the number of best selling item sold.&lt;/P&gt;

&lt;P&gt;My search query is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;buttercup*  price=* action=purchase|iplocation clientip|stats max(productId) as "Best Seller" count as "Sold Total" by Country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried count(max(productId)) which doesn't seem to work.&lt;/P&gt;

&lt;P&gt;Can I get help or any suggestion for which command to use to get a chart like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      Country            Best Seller       Sold           Sold Total
     Argentina            WC-SH-G04         3                11
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 16:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Search-Tutorial-data-how-to-search-for-the-total-number-of/m-p/134486#M36759</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2014-11-25T16:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using Search Tutorial data, how to search for the total number of items sold, the best selling item, and number of the best selling item sold by country?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Search-Tutorial-data-how-to-search-for-the-total-number-of/m-p/134487#M36760</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;buttercup*  price=* action=purchase|iplocation clientip | stats count by productId Country  | eventstats max(count) as max by Country | eval BestSeller=if(count=max,productId,null()) | stats values(BestSeller) as "Best Seller" , first(max) as Sold, sum(count) as "Sold Total" by Country
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Nov 2014 16:22:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Search-Tutorial-data-how-to-search-for-the-total-number-of/m-p/134487#M36760</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-11-25T16:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using Search Tutorial data, how to search for the total number of items sold, the best selling item, and number of the best selling item sold by country?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Search-Tutorial-data-how-to-search-for-the-total-number-of/m-p/134488#M36761</link>
      <description>&lt;P&gt;This is a great example to add to the Search Tutorial. Thank you! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2014 08:32:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Search-Tutorial-data-how-to-search-for-the-total-number-of/m-p/134488#M36761</guid>
      <dc:creator>sophy</dc:creator>
      <dc:date>2014-11-26T08:32:40Z</dc:date>
    </item>
  </channel>
</rss>

