<?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 how to calculate multiple stats count? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-calculate-multiple-stats-count/m-p/66599#M16573</link>
    <description>&lt;P&gt;i have following data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;playdate, adid, store, 
2011-08-23, 1 , s1
2011-08-23, 2, s2
2011-08-23, 1, s2
2011-08-25, 2, s2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i need to calculate calculate:&lt;/P&gt;

&lt;P&gt;How many time each &lt;CODE&gt;adid&lt;/CODE&gt; played on each &lt;CODE&gt;playdate&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and in how many stores the &lt;CODE&gt;adid&lt;/CODE&gt; played on each &lt;CODE&gt;playdate&lt;/CODE&gt;     &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;adid    playdate    #of plays on each day       #of stores play on each day
1       2011-08-23  2                               2
2       2011-08-23  1                               1
2       2011-08-25  1                               1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is what i tried but no data returned&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search..|stats count BY adid, playdate| stats sum BY adid, playdate, store
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope i explain properly&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2011 22:43:15 GMT</pubDate>
    <dc:creator>desi</dc:creator>
    <dc:date>2011-08-29T22:43:15Z</dc:date>
    <item>
      <title>how to calculate multiple stats count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-calculate-multiple-stats-count/m-p/66599#M16573</link>
      <description>&lt;P&gt;i have following data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;playdate, adid, store, 
2011-08-23, 1 , s1
2011-08-23, 2, s2
2011-08-23, 1, s2
2011-08-25, 2, s2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i need to calculate calculate:&lt;/P&gt;

&lt;P&gt;How many time each &lt;CODE&gt;adid&lt;/CODE&gt; played on each &lt;CODE&gt;playdate&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and in how many stores the &lt;CODE&gt;adid&lt;/CODE&gt; played on each &lt;CODE&gt;playdate&lt;/CODE&gt;     &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;adid    playdate    #of plays on each day       #of stores play on each day
1       2011-08-23  2                               2
2       2011-08-23  1                               1
2       2011-08-25  1                               1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is what i tried but no data returned&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search..|stats count BY adid, playdate| stats sum BY adid, playdate, store
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope i explain properly&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2011 22:43:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-calculate-multiple-stats-count/m-p/66599#M16573</guid>
      <dc:creator>desi</dc:creator>
      <dc:date>2011-08-29T22:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate multiple stats count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-calculate-multiple-stats-count/m-p/66600#M16574</link>
      <description>&lt;P&gt;Assuming the 'playdate' time is getting recognized by Splunk and used as the index time,  then I think this is what you're looking for: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search...&amp;gt; | bin _time span="1d" | stats dc(adid) dc(store) by adid, _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Aug 2011 23:53:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-calculate-multiple-stats-count/m-p/66600#M16574</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-08-29T23:53:50Z</dc:date>
    </item>
  </channel>
</rss>

