<?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 chart year without the comma using scatterplot? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-chart-year-without-the-comma-using-scatterplot/m-p/285220#M602</link>
    <description>&lt;P&gt;Hi somesoni2, &lt;/P&gt;

&lt;P&gt;Thank you for the suggestions. I tried all there and here are the results. Unfortunately, the x-axis is still not showing the year or date correctly.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;== Set 1==&lt;/STRONG&gt;&lt;BR /&gt;
- on Statistics tab&lt;/P&gt;

&lt;P&gt;results are returned in the following format:&lt;BR /&gt;
Category, Order Year, Profit&lt;BR /&gt;
Furniture, Y2011, 5450&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;on Visualization tab
When visualized results using Scatter Chart, the X axis values are showing as 
0 10 20 30 40 50 ... 90
instead of 
Y2011 Y2012... etc&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;And all the values are bunched together on x=0. Not sure why that is happening.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;== Set 2==&lt;/STRONG&gt;&lt;BR /&gt;
I added following line to the search to format data for the scatter plot&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table Category, _time, Profit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;on Statistics tab&lt;BR /&gt;
the results are returned in the following format: &lt;BR /&gt;
Category,_time, Profit&lt;BR /&gt;
Furniture, 2011, 5450&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;on Visualization tab&lt;BR /&gt;
When visualized results using Scatter Chart, the X axis values are showing as &lt;BR /&gt;
2,010    2,011    2,012    2,013&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Looks like the scatterplot is still interpreting the x axis values as numeric. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;== Set 3==&lt;/STRONG&gt;&lt;BR /&gt;
I added following line to the search to format data for the scatter plot&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table Category _time Profit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;on Statistics tab&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;results are returned in the following format:&lt;BR /&gt;
Category, Order Year, Profit&lt;BR /&gt;
Furniture, 2011-01-05, 5450&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;on Visualization tab
When visualized results using Scatter Chart, the X axis values are showing as 
0 10 20 30 40 50 ... 90
instead of 
2011-01-05
2011-01-10
etc..&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;And all the values are bunched together on x=0. &lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2017 00:59:41 GMT</pubDate>
    <dc:creator>zerosones</dc:creator>
    <dc:date>2017-02-15T00:59:41Z</dc:date>
    <item>
      <title>How to chart year without the comma using scatterplot?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-chart-year-without-the-comma-using-scatterplot/m-p/285218#M600</link>
      <description>&lt;P&gt;Hi Splunk community, &lt;/P&gt;

&lt;P&gt;I have the following search to chart the profit of each product category by year. "Order Date" values are in format "02/14/2013".&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sales_orders" 
| eval Profit = round(Profit, 0) 
| eval order_year = strftime(strptime('Order Date',"%m/%d/%Y"),"%Y")
| stats sum(Profit) as Profit by order_year, Category
| table Category,  order_year, Profit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When executed, the order_year column on Statistics tab returns values as the following without a comma separator:&lt;/P&gt;

&lt;P&gt;2013&lt;BR /&gt;
2014&lt;/P&gt;

&lt;P&gt;But when it's charted on the Visualization tab as scatterplot, the x-axis labels are showing "2,013", "2,014" instead with a comma separator. &lt;/P&gt;

&lt;P&gt;I've tried turning off the comma separator in the order_year column and that didn't seem to affect the visualization.&lt;/P&gt;

&lt;P&gt;I then thought I try to create a string field for the order year and graph by the string version of the year instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sales_orders" 
| eval Profit = round(Profit, 0) 
| eval order_year = strftime(strptime('Order Date',"%m/%d/%Y"),"%Y")
| stats sum(Profit) as Profit by order_year, Category
| eval "Order Year" = tostring(order_year)
| table Category,  "Order Year", Profit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Still, the scatter plot x-axis label is showing "2,012" "2,013", etc even though the "Order Year" values on the Statistics tab shows "2012" "2013". &lt;/P&gt;

&lt;P&gt;Can anyone guide me on how to get rid of the comma separator in x-axis when charting?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2017 22:18:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-chart-year-without-the-comma-using-scatterplot/m-p/285218#M600</guid>
      <dc:creator>zerosones</dc:creator>
      <dc:date>2017-02-12T22:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to chart year without the comma using scatterplot?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-chart-year-without-the-comma-using-scatterplot/m-p/285219#M601</link>
      <description>&lt;P&gt;Give these a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sales_orders" 
 | eval Profit = round(Profit, 0) 
 | eval order_year = strftime(strptime('Order Date',"%m/%d/%Y"),"Y%Y")
 | stats sum(Profit) as Profit by order_year, Category
 | rename order_year as "Order Year"
 | table Category,  "Order Year", Profit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sales_orders" 
| eval Profit = round(Profit, 0) 
| eval _time= strptime('Order Date',"%m/%d/%Y")
| stats sum(Profit) as Profit by _time Category
| fieldformat _time=strftime(_time,"%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sales_orders" 
| eval Profit = round(Profit, 0) 
| eval _time= strptime('Order Date',"%m/%d/%Y")
| stats sum(Profit) as Profit by _time Category
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Feb 2017 04:31:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-chart-year-without-the-comma-using-scatterplot/m-p/285219#M601</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-13T04:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to chart year without the comma using scatterplot?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-chart-year-without-the-comma-using-scatterplot/m-p/285220#M602</link>
      <description>&lt;P&gt;Hi somesoni2, &lt;/P&gt;

&lt;P&gt;Thank you for the suggestions. I tried all there and here are the results. Unfortunately, the x-axis is still not showing the year or date correctly.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;== Set 1==&lt;/STRONG&gt;&lt;BR /&gt;
- on Statistics tab&lt;/P&gt;

&lt;P&gt;results are returned in the following format:&lt;BR /&gt;
Category, Order Year, Profit&lt;BR /&gt;
Furniture, Y2011, 5450&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;on Visualization tab
When visualized results using Scatter Chart, the X axis values are showing as 
0 10 20 30 40 50 ... 90
instead of 
Y2011 Y2012... etc&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;And all the values are bunched together on x=0. Not sure why that is happening.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;== Set 2==&lt;/STRONG&gt;&lt;BR /&gt;
I added following line to the search to format data for the scatter plot&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table Category, _time, Profit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;on Statistics tab&lt;BR /&gt;
the results are returned in the following format: &lt;BR /&gt;
Category,_time, Profit&lt;BR /&gt;
Furniture, 2011, 5450&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;on Visualization tab&lt;BR /&gt;
When visualized results using Scatter Chart, the X axis values are showing as &lt;BR /&gt;
2,010    2,011    2,012    2,013&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Looks like the scatterplot is still interpreting the x axis values as numeric. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;== Set 3==&lt;/STRONG&gt;&lt;BR /&gt;
I added following line to the search to format data for the scatter plot&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table Category _time Profit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;on Statistics tab&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;results are returned in the following format:&lt;BR /&gt;
Category, Order Year, Profit&lt;BR /&gt;
Furniture, 2011-01-05, 5450&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;on Visualization tab
When visualized results using Scatter Chart, the X axis values are showing as 
0 10 20 30 40 50 ... 90
instead of 
2011-01-05
2011-01-10
etc..&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;And all the values are bunched together on x=0. &lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 00:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-chart-year-without-the-comma-using-scatterplot/m-p/285220#M602</guid>
      <dc:creator>zerosones</dc:creator>
      <dc:date>2017-02-15T00:59:41Z</dc:date>
    </item>
  </channel>
</rss>

