<?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 create a month over month, year over year report on web analytics metrics data from CSV files? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196026#M38982</link>
    <description>&lt;P&gt;Don't know if you can do that generic. But surely you can do it absolutely:&lt;/P&gt;

&lt;PRE&gt;YOURSEARCH earliest=-1month@month latest=@month |eval month_0=strftime(_time,"%m") | stats sum(num_users) as users_0 by month_0
| append [ YOURSEARCH earliest=-2month@month latest=-1month@month | eval month_1=strftime(_time,"%m") | stats sum(num_users) as users_1 by month_1]
| append ....
| eval users_1_0=(users_0/users_1) users_2_1=(users_1/users_2) ...
| table month_0,users_0,month_1,users_1_0, ...&lt;/PRE&gt;

&lt;P&gt;not sure, if I got the code right. Might have typos or fallacies.&lt;/P&gt;

&lt;P&gt;I think in your case aggregating values might be a good option.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Nov 2014 11:57:05 GMT</pubDate>
    <dc:creator>Muryoutaisuu</dc:creator>
    <dc:date>2014-11-11T11:57:05Z</dc:date>
    <item>
      <title>How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196021#M38977</link>
      <description>&lt;P&gt;Hi folks!&lt;BR /&gt;
This is my first post here. I am new to Splunk although I have been intensively working with it for the last 8 weeks. I would appreciate some help for you to create a report. I have read dozens of posts, even the great Exploring Splunk book by D. Carasso but couldn't get exactly what I am trying to achieve.&lt;BR /&gt;
I have daily events from csv files with some web analytics metrics. What I want is to generate a report in the following way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;month    users  usersMoM  usersYoY  sessions  sessionsMoM sessionYoY ...
201410  500 10%    -4%      25000     12%       -3% ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where MoM compares the metric towards the value from previous month (201409) and YoY towards the value from the same month from previous year (201310)&lt;BR /&gt;
Is it possible?&lt;BR /&gt;
Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 11:42:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196021#M38977</guid>
      <dc:creator>jrcajide</dc:creator>
      <dc:date>2014-11-05T11:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196022#M38978</link>
      <description>&lt;P&gt;Hi. Assuming situation from your question:&lt;/P&gt;

&lt;P&gt;current  month = 201411&lt;/P&gt;

&lt;P&gt;month = 201410&lt;/P&gt;

&lt;P&gt;previous month = 201409&lt;/P&gt;

&lt;P&gt;Try:&lt;/P&gt;

&lt;PRE&gt; YOURSEARCH -1month@month latest=@month | stats count users as users_month
| append [ YOURSEARCH earliest=-2month@month latest=-1month@month | stats count users as users_MoM ]
| append [ YOURSEARCH earliest=-1y@month-1month latest=-1y@month | stats count users as users_YoY
| eval users_MoM_perc=(users_month / users_MoM) users_YoY_perc=(users_month / users_YoY)
| table month,users_month AS users,users_MoM_perc,users_YoY_perc ...&lt;/PRE&gt;

&lt;P&gt;If you have difficulties defining rigth time definition, click on the timepicker and go to Advanced. Beneath the expressions Splunk will show you the selected date.&lt;/P&gt;

&lt;P&gt;Might have typos. Hope this helps nevertheless.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 13:10:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196022#M38978</guid>
      <dc:creator>Muryoutaisuu</dc:creator>
      <dc:date>2014-11-05T13:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196023#M38979</link>
      <description>&lt;P&gt;Thank you Muryoutaisuu&lt;BR /&gt;
I have been trying you approach but I can get what I'm trying.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* earliest=-2month@month latest=@month | eval month=strftime(_time,"%m") | stats sum(num_users) as users_month by month 
 | append [* earliest=-2month@month latest=-1month@month | stats sum(num_users) as users_MoM  | stats first(users_MoM) as prevoius_month  ] |table month users_month prevoius_month
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This returns users_month correctly, and also calculate prevoius_month users but in a new row. Also It doesn't calculate prevoius_month users for previous months, only for the last one.&lt;/P&gt;

&lt;P&gt;Any idea? Thanks so much&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196023#M38979</guid>
      <dc:creator>jrcajide</dc:creator>
      <dc:date>2020-09-28T18:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196024#M38980</link>
      <description>&lt;P&gt;Why are you searching in your first search &lt;CODE&gt;earliest=-2month@month&lt;/CODE&gt; instead of &lt;CODE&gt;-1month@month&lt;/CODE&gt; ? Your range now is two months.&lt;/P&gt;

&lt;P&gt;In your second search: Is it really necessary to make the &lt;CODE&gt;stats first(...) as ...&lt;/CODE&gt; ? I don't see the reason.&lt;/P&gt;

&lt;P&gt;Quote: "Also It doesn't calculate prevoius_month users for previous months, only for the last one." I thought that was as intended? If you want your search to take a median, you need your subsearch to sum the users from something like &lt;CODE&gt;append [ YOURSEARCH earliest=-13month@month latest=-1month@month  | stats sum(num_users) AS users_MoM | eval previous_months=(users_MoM/12) ]&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196024#M38980</guid>
      <dc:creator>Muryoutaisuu</dc:creator>
      <dc:date>2020-09-28T18:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196025#M38981</link>
      <description>&lt;P&gt;But, what I am trying is to get a dataset, a full year to data, each month in a row with a column that is a comparison with prevoius month... &lt;BR /&gt;
Is that possible?&lt;BR /&gt;
Thanks &lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 11:36:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196025#M38981</guid>
      <dc:creator>jrcajide</dc:creator>
      <dc:date>2014-11-11T11:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196026#M38982</link>
      <description>&lt;P&gt;Don't know if you can do that generic. But surely you can do it absolutely:&lt;/P&gt;

&lt;PRE&gt;YOURSEARCH earliest=-1month@month latest=@month |eval month_0=strftime(_time,"%m") | stats sum(num_users) as users_0 by month_0
| append [ YOURSEARCH earliest=-2month@month latest=-1month@month | eval month_1=strftime(_time,"%m") | stats sum(num_users) as users_1 by month_1]
| append ....
| eval users_1_0=(users_0/users_1) users_2_1=(users_1/users_2) ...
| table month_0,users_0,month_1,users_1_0, ...&lt;/PRE&gt;

&lt;P&gt;not sure, if I got the code right. Might have typos or fallacies.&lt;/P&gt;

&lt;P&gt;I think in your case aggregating values might be a good option.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 11:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196026#M38982</guid>
      <dc:creator>Muryoutaisuu</dc:creator>
      <dc:date>2014-11-11T11:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196027#M38983</link>
      <description>&lt;P&gt;Don't know why I forgot to bring up that exceptional tool:&lt;/P&gt;

&lt;P&gt;timewrap: &lt;A href="https://apps.splunk.com/app/1645/"&gt;https://apps.splunk.com/app/1645/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;download and install it and then make your search something like that:&lt;/P&gt;

&lt;PRE&gt;YOURSEARCH earliest=-1year@month latest=@month
| timechart sum(num_users)
| timewrap m
&lt;/PRE&gt;

&lt;P&gt;The you also can make a fancy chart&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 14:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196027#M38983</guid>
      <dc:creator>Muryoutaisuu</dc:creator>
      <dc:date>2014-11-11T14:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196028#M38984</link>
      <description>&lt;P&gt;Have you tried the timewrap app?  It adds a new Splunk search command that was specifically created for time over time comparisons.  You can get it here:  &lt;A href="https://apps.splunk.com/app/1645/"&gt;https://apps.splunk.com/app/1645/&lt;/A&gt;.  Give it a try and see if it works for you.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 14:21:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196028#M38984</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2014-11-11T14:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196029#M38985</link>
      <description>&lt;P&gt;You're too quick for me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 14:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196029#M38985</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2014-11-11T14:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196030#M38986</link>
      <description>&lt;P&gt;Got me 6 days to remember timewrap... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 14:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196030#M38986</guid>
      <dc:creator>Muryoutaisuu</dc:creator>
      <dc:date>2014-11-11T14:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a month over month, year over year report on web analytics metrics data from CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196031#M38987</link>
      <description>&lt;P&gt;What about this approach?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchstring  earliest=-12month@month latest=-1month@month
| bucket _time span=1mon
| stats sum(users) as users by _time
| eval Month = strftime(_time, "%b %Y")  | addinfo
| appendcols [ search searchstring
| eval earliest_time=relative_time(info_min_time,"-2m")
| eval latest_time=relative_time(info_max_time,"-1m")| where _time&amp;gt;earliest_time and _time&amp;lt;=latest_time| eval ReportKey="previousmonth"| timechart span=1mon sum(users) as prev_month_users  by previousmonth]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think is the way to get previous month value for every month but relative_time functions or addinfo seems not to be working ...&lt;BR /&gt;
Thank you again for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 08:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-month-over-month-year-over-year-report-on-web/m-p/196031#M38987</guid>
      <dc:creator>jrcajide</dc:creator>
      <dc:date>2014-11-12T08:37:10Z</dc:date>
    </item>
  </channel>
</rss>

