<?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 can group age? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26008#M4976</link>
    <description>&lt;P&gt;On the other hand if you want to group by the Age brackets in the rows, but split by the Product Name in the columns, then you can only do one statistic at a time, but that would look like this: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="inforce_analytix" | eval Age=2013-Subscriber_Birth_Year | bin Age span=5 | eval Total_Covered_Amount=(coverage_Amount1+coverage_Amount1) | chart sum(Total_Covered_Amount) over Age by Product_Name&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2013 18:48:22 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2013-05-07T18:48:22Z</dc:date>
    <item>
      <title>How can group age?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26003#M4971</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;

&lt;P&gt;I have data like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;age count
23  76
24  154
25  168
26  140
27  132
28  156
29  152
30  167
31  144
32  133
33  78
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone tell me how can group the age like 20-25,26-30,31-35 and add the counts depending on age.&lt;/P&gt;

&lt;P&gt;Thanks &lt;BR /&gt;
Gajana Hiroji&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 06:01:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26003#M4971</guid>
      <dc:creator>gajananh999</dc:creator>
      <dc:date>2013-05-07T06:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can group age?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26004#M4972</link>
      <description>&lt;P&gt;This search syntax: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | bin age span=5 | stats sum(count) as count by age&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;will turn this into rows that have an 'age' field whose values are '15-20', '20-25', '25-30',   and a 'count' field whose values are the appropriate sums. &lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 06:46:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26004#M4972</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-05-07T06:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can group age?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26005#M4973</link>
      <description>&lt;P&gt;You could use &lt;CODE&gt;rangemap&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rangemap field=age "20-25"=20-25 "26-30"=26-30 "31-35"=31-35 ... default="other age"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create the field &lt;CODE&gt;range&lt;/CODE&gt; which holds the ranges you define in your &lt;CODE&gt;rangemap&lt;/CODE&gt; command. You can then do&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rangemap ... | stats count by range
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;EDIT: ...though sideview's suggestion of using &lt;CODE&gt;bin&lt;/CODE&gt; is better.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 06:47:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26005#M4973</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-05-07T06:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can group age?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26006#M4974</link>
      <description>&lt;P&gt;Thank you for your reply its worked for me &lt;/P&gt;

&lt;P&gt;but one small doubt&lt;BR /&gt;
Age      Product_Name      Coveamt     covper   totalpre&lt;BR /&gt;
20-25   Children Plans     107882008   453  12611869&lt;BR /&gt;&lt;BR /&gt;
        Investment Plans&lt;BR /&gt;
        Protection Plans&lt;BR /&gt;
        Retirement Plans&lt;BR /&gt;
        Savings Plans&lt;/P&gt;

&lt;P&gt;index="inforce_analytix"|eval Age=2013-Subscriber_Birth_Year |bin Age span=5 | eval Total Covered Amount=(coverage_Amount1+coverage_Amount1)| stats values(Product_Name),sum(Total Covered Amount),sum(NumberOfCoveredPersons),sum(Policy_Premium) by Age&lt;BR /&gt;
I want the data like by product_name also coveramt,covper,totalpre should come&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:50:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26006#M4974</guid>
      <dc:creator>gajananh999</dc:creator>
      <dc:date>2020-09-28T13:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can group age?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26007#M4975</link>
      <description>&lt;P&gt;If you want to group by Product_Name as well as Age, so each row is one of the unique combinations of Product_Name and age bracket,  then do this: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="inforce_analytix" | eval Age=2013-Subscriber_Birth_Year | bin Age span=5 | eval Total_Covered_Amount=(coverage_Amount1+coverage_Amount1) | stats sum(Total_Covered_Amount),sum(NumberOfCoveredPersons),sum(Policy_Premium) by Age Product_Name&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:51:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26007#M4975</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2020-09-28T13:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can group age?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26008#M4976</link>
      <description>&lt;P&gt;On the other hand if you want to group by the Age brackets in the rows, but split by the Product Name in the columns, then you can only do one statistic at a time, but that would look like this: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="inforce_analytix" | eval Age=2013-Subscriber_Birth_Year | bin Age span=5 | eval Total_Covered_Amount=(coverage_Amount1+coverage_Amount1) | chart sum(Total_Covered_Amount) over Age by Product_Name&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 18:48:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-group-age/m-p/26008#M4976</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-05-07T18:48:22Z</dc:date>
    </item>
  </channel>
</rss>

