<?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 Pie charting data below in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325560#M39575</link>
    <description>&lt;P&gt;Hello Guys,  I have a query. I want to show the following data as pie where the pie visualisation should have a count of -ve value, +ve value and values showing pending with the projects to which they are attached to. Below is the data tabled.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    30  Trendmicro implementation
    30  Trendmicro implementation
    Pending Trendmicro implementation
    Pending Trendmicro implementation
    Pending Trendmicro implementation
    -18 Trendmicro implementation
    -18 Trendmicro implementation
    -18 Trendmicro implementation
    -18 Trendmicro implementation


426 Mcafee installation
426 Mcafee installation
426 Mcafee installation
Pending Mcafee installation
-37 Mcafee installation
-37 Mcafee installation
-37 Mcafee installation
-37 Mcafee installation
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So ideally for me the pie chart would be having 3 slices where +ve values are 1 piece, --ve value is 1 piece and pending is also 1 pie. Is there a method  where we can visualise the data?&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 13:21:59 GMT</pubDate>
    <dc:creator>ranjitbrhm1</dc:creator>
    <dc:date>2018-04-10T13:21:59Z</dc:date>
    <item>
      <title>Pie charting data below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325560#M39575</link>
      <description>&lt;P&gt;Hello Guys,  I have a query. I want to show the following data as pie where the pie visualisation should have a count of -ve value, +ve value and values showing pending with the projects to which they are attached to. Below is the data tabled.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    30  Trendmicro implementation
    30  Trendmicro implementation
    Pending Trendmicro implementation
    Pending Trendmicro implementation
    Pending Trendmicro implementation
    -18 Trendmicro implementation
    -18 Trendmicro implementation
    -18 Trendmicro implementation
    -18 Trendmicro implementation


426 Mcafee installation
426 Mcafee installation
426 Mcafee installation
Pending Mcafee installation
-37 Mcafee installation
-37 Mcafee installation
-37 Mcafee installation
-37 Mcafee installation
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So ideally for me the pie chart would be having 3 slices where +ve values are 1 piece, --ve value is 1 piece and pending is also 1 pie. Is there a method  where we can visualise the data?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 13:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325560#M39575</guid>
      <dc:creator>ranjitbrhm1</dc:creator>
      <dc:date>2018-04-10T13:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Pie charting data below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325561#M39576</link>
      <description>&lt;P&gt;You first need to extract those values(e.g. -18, pending etc) in field called &lt;CODE&gt;count&lt;/CODE&gt;,  then try something like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval type=case(count&amp;lt;1, "-ve", count &amp;gt;= 1, "+ve", count=="Pending", "Pending") | stats count by type
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Apr 2018 13:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325561#M39576</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-10T13:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pie charting data below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325562#M39577</link>
      <description>&lt;P&gt;@ranjitbrhm1, what does the positive and negative values indicate? Do you need those to be represented as well?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 15:03:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325562#M39577</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-10T15:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pie charting data below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325563#M39578</link>
      <description>&lt;P&gt;Thank you all for the suggestions. I wrote a query very similar to &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/85706"&gt;@p_gurav&lt;/a&gt; answer&lt;BR /&gt;
    index="bsg" | eval deadline_epoch=strptime(task_deadline,"%m/%d/%Y")| eval end_epoch=strptime(task_end_date,"%m/%d/%Y") |eval diffrence=(end_epoch-deadline_epoch) |eval p_status=round((diffrence)/86400,0) | fillnull value=pending| stats count(eval(p_status&amp;gt;0)) as on_time, count(eval(p_status&amp;lt;0)) as delayed, count(eval(p_status=pending)) as deffered by Project_Title&lt;/P&gt;

&lt;P&gt;But my challenge now is on the pie its not showing the delayed and on time correctly and deffered split by project name. My sample data looks like this. I uploaded it off a CSV that we created,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Project_Title   Project_Manager task_start_date task_end_date   task_deadline   Tasks   project_start_date  project_end_date    project_completed_date
Splunk Implementation   Imran   2/2/2018    4/1/2018    3/2/2018    Install os  2/2/2018    3/5/2018    
Splunk Implementation   Imran   2/2/2018    4/1/2018    3/2/2018    Assign host name    2/2/2018    3/5/2018    
Splunk Implementation   Imran   2/2/2018    4/1/2018    3/2/2018    Assign IP address   2/2/2018    3/5/2018    
Splunk Implementation   Imran   2/2/2018    4/1/2018    3/2/2018    Install splunk  2/2/2018    3/5/2018    
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325563#M39578</guid>
      <dc:creator>ranjitbrhm1</dc:creator>
      <dc:date>2020-09-29T18:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Pie charting data below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325564#M39579</link>
      <description>&lt;P&gt;@ranjitbrhm1, following is a &lt;CODE&gt;run anywhere example with mocked up data&lt;/CODE&gt; based on your sample data and query provided.&lt;BR /&gt;
I have added a &lt;CODE&gt;transpose&lt;/CODE&gt; command at the end for creating the pie chart. Mock data has &lt;CODE&gt;2 On-Time&lt;/CODE&gt;, &lt;CODE&gt;1 Delayed&lt;/CODE&gt; and &lt;CODE&gt;1 Pending&lt;/CODE&gt; task for the Project.&lt;BR /&gt;
PS: Command from &lt;CODE&gt;| makeresults&lt;/CODE&gt; till &lt;CODE&gt;|  fields - data&lt;/CODE&gt; cook up dummy data, you would need to use your own query instead.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults
|  fields - _time 
|  eval data="Splunk Implementation,Imran,2/2/2018,,3/2/2018,Install os,2/2/2018,3/5/2018;Splunk Implementation,Imran,2/2/2018,4/1/2018,3/2/2018,Assign host name,2/2/2018,3/5/2018;Splunk Implementation,Imran,2/2/2018,4/1/2018,3/2/2018,Assign IP address,2/2/2018,3/5/2018;Splunk Implementation,Imran,2/2/2018,4/1/2018,4/12/2018,Install splunk,2/2/2018,3/5/2018"
|  makemv data delim=";"
|  mvexpand data
|  eval data=split(data,",")
|  eval Project_Title=mvindex(data,0), Project_Manager=mvindex(data,1), task_start_date=mvindex(data,2), task_end_date=mvindex(data,3), task_deadline=mvindex(data,4), Tasks=mvindex(data,5), project_start_date=mvindex(data,6), project_end_date=mvindex(data,7), project_completed_date=mvindex(data,8)
|  fields - data
|  eval deadline_epoch=strptime(task_deadline,"%m/%d/%Y"), end_epoch=strptime(task_end_date,"%m/%d/%Y")
|  eval p_status=round(((end_epoch-deadline_epoch)/86400),0)
|  stats count(eval(isnull(p_status))) as "Pending" count(eval(isnotnull(p_status) AND p_status&amp;gt;=0)) as "On-time"  count(eval(isnotnull(p_status) AND p_status&amp;lt;0)) as "Delayed" by Project_Title
|  transpose header_field=Project_Title column_name=Project_Title
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 18:34:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325564#M39579</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-10T18:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Pie charting data below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325565#M39580</link>
      <description>&lt;P&gt;This is proper.  Thanks @niketnilay for taking effort in writing the query for me.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 11:33:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-charting-data-below/m-p/325565#M39580</guid>
      <dc:creator>ranjitbrhm1</dc:creator>
      <dc:date>2018-04-11T11:33:50Z</dc:date>
    </item>
  </channel>
</rss>

