<?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 use eval to group dates? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-to-group-dates/m-p/460158#M191305</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| stats values(Country) as Country   sum(Price) as Price  by Date  City
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Aug 2019 04:11:06 GMT</pubDate>
    <dc:creator>nareshinsvu</dc:creator>
    <dc:date>2019-08-23T04:11:06Z</dc:date>
    <item>
      <title>How to use eval to group dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-to-group-dates/m-p/460157#M191304</link>
      <description>&lt;P&gt;I have 4 columns of data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Country    City    Date    Price
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to make a table where the &lt;CODE&gt;Price&lt;/CODE&gt; column is is summed for each day for a particular City&lt;/P&gt;

&lt;P&gt;Example raw data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Country    City    Date    Price
a1          b1      2019-01-01    5
a1          b2      2019-01-01    3
a2          c1      2019-01-02    4
a2          c1      2019-01-02    7
a2          c2      2019-01-02    2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Desired Output (only the &lt;CODE&gt;Price&lt;/CODE&gt; in city c1 is summed because it has 2 entries on the same date):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Country    City    Date    Price
a1          b1      2019-01-01    5
a1          b2      2019-01-01    3
a2          c1      2019-01-02    11
a2          c2      2019-01-02    2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried using &lt;CODE&gt;eventstats sum(Price) as newPrice by Date&lt;/CODE&gt;  but it gives weird number for the new column. &lt;/P&gt;

&lt;P&gt;I would appreciate any and all help! Please and thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 02:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-to-group-dates/m-p/460157#M191304</guid>
      <dc:creator>viandyg</dc:creator>
      <dc:date>2019-08-23T02:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval to group dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-to-group-dates/m-p/460158#M191305</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| stats values(Country) as Country   sum(Price) as Price  by Date  City
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Aug 2019 04:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-to-group-dates/m-p/460158#M191305</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-08-23T04:11:06Z</dc:date>
    </item>
  </channel>
</rss>

