<?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 I sort results for previous week and current week in two seperate columns? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/612649#M213002</link>
    <description>&lt;P&gt;You didn't specify how frequently data is collected, so I'll assume that they can be aggregated into as a weekly stats by something like earliest=-2w@w latest=0w@w. &amp;nbsp;With this assumption, you can do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;* earliest=-2w@w latest=0w@w
| bin span=1w@w _time
| stats count by CustomerName Error _time
| stats earliest(count) as ResultPrev latest(count) as Result max(_time) as _time by CustomerName Error
| eventstats sum(Result) as "Percent of Total"
| eval "Percent Difference" = round((Result - ResultPrev)/ResultPrev * 100, 2), "Percent of Total" = round(Result / 'Percent of Total' * 100, 2)&lt;/LI-CODE&gt;&lt;P&gt;Of course, replace "*" with your real search.&lt;/P&gt;</description>
    <pubDate>Sun, 11 Sep 2022 01:42:39 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-09-11T01:42:39Z</dc:date>
    <item>
      <title>How can I sort results for previous week and current week in two seperate columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/612591#M212986</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;How can i display the results for 2022-09-02 in Result_Prev column and 2022-09-09 in Result column and keeping the other columns same. Calculating Percent difference from a this week to the previous week results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wanda619_0-1662734632865.png" style="width: 776px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21407iA25F3C645A62CAE5/image-dimensions/776x261?v=v2" width="776" height="261" role="button" title="wanda619_0-1662734632865.png" alt="wanda619_0-1662734632865.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;any help is appreciated. Thank you !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 14:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/612591#M212986</guid>
      <dc:creator>wanda619</dc:creator>
      <dc:date>2022-09-09T14:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort results for previous week and current week in two seperate columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/612649#M213002</link>
      <description>&lt;P&gt;You didn't specify how frequently data is collected, so I'll assume that they can be aggregated into as a weekly stats by something like earliest=-2w@w latest=0w@w. &amp;nbsp;With this assumption, you can do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;* earliest=-2w@w latest=0w@w
| bin span=1w@w _time
| stats count by CustomerName Error _time
| stats earliest(count) as ResultPrev latest(count) as Result max(_time) as _time by CustomerName Error
| eventstats sum(Result) as "Percent of Total"
| eval "Percent Difference" = round((Result - ResultPrev)/ResultPrev * 100, 2), "Percent of Total" = round(Result / 'Percent of Total' * 100, 2)&lt;/LI-CODE&gt;&lt;P&gt;Of course, replace "*" with your real search.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 01:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/612649#M213002</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-11T01:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort results for previous week and current week in two seperate columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/612925#M213062</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;The data is collected daliy as there are daily transactions and the error are shown daily&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 19:07:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/612925#M213062</guid>
      <dc:creator>wanda619</dc:creator>
      <dc:date>2022-09-13T19:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort results for previous week and current week in two seperate columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/613126#M213084</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;I am having this error when I am trying to use the above code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wanda619_0-1663174726748.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21472i47A634EC8DC9745F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wanda619_0-1663174726748.png" alt="wanda619_0-1663174726748.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:58:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/613126#M213084</guid>
      <dc:creator>wanda619</dc:creator>
      <dc:date>2022-09-14T16:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort results for previous week and current week in two seperate columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/613510#M213225</link>
      <description>&lt;P data-unlink="true"&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248216"&gt;@wanda619&lt;/a&gt;&amp;nbsp;My mistake. &amp;nbsp;Should be &lt;A href="mailto:-0w@w" target="_blank"&gt;-0w@w&lt;/A&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;* earliest=-2w@w latest=-0w@w
| bin span=1w@w _time
| stats count by CustomerName Error _time
| stats earliest(count) as ResultPrev latest(count) as Result max(_time) as _time by CustomerName Error
| eventstats sum(Result) as "Percent of Total"
| eval "Percent Difference" = round((Result - ResultPrev)/ResultPrev * 100, 2), "Percent of Total" = round(Result / 'Percent of Total' * 100, 2)&lt;/LI-CODE&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 18:11:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/613510#M213225</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-17T18:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort results for previous week and current week in two seperate columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/613790#M213313</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;when i try to search itby the above code you mentioned, I did not get the errors i needed as it is blanking and giving 0 outputs on results column.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wanda619_0-1663686699861.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21563iC14A318ACBB34763/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wanda619_0-1663686699861.png" alt="wanda619_0-1663686699861.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 15:12:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/613790#M213313</guid>
      <dc:creator>wanda619</dc:creator>
      <dc:date>2022-09-20T15:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort results for previous week and current week in two seperate columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/613812#M213315</link>
      <description>&lt;P&gt;If "Results" column is 0, that means count in the first stats command is also 0, i.e., if you run&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;* earliest=-2w@w latest=-0w@w
| bin span=1w@w _time
| stats count by CustomerName Error _time&lt;/LI-CODE&gt;&lt;P&gt;count should all be zero. &amp;nbsp;Can you confirm that? &amp;nbsp;Maybe there's some spelling error? &amp;nbsp;Does the main search return anything?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 17:24:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-results-for-previous-week-and-current-week-in-two/m-p/613812#M213315</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-20T17:24:20Z</dc:date>
    </item>
  </channel>
</rss>

