<?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: Stacked bar graph using data across multiple indexes in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129174#M44410</link>
    <description>&lt;P&gt;If I'm correct as to what you're asking, it may be as simple as instead of using stats using &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/chart"&gt;chart&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart sum(ORDERTOTAL) over age_group by index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 07 Apr 2015 17:07:29 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-04-07T17:07:29Z</dc:date>
    <item>
      <title>Stacked bar graph using data across multiple indexes</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129171#M44407</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Need your guidance on developing below panel , here are the details...&lt;/P&gt;

&lt;P&gt;index=index1 &lt;BR /&gt;
index=index 2&lt;BR /&gt;
index=index 3&lt;/P&gt;

&lt;P&gt;All the above 3 indexes represent data corresponding to different order types .&lt;/P&gt;

&lt;P&gt;Each of the index has fields  order_no , order_date , OrderAmount. All the 3 indexes have the same columns.&lt;/P&gt;

&lt;P&gt;I need to display data from above 3 indexes in the form of stacked bar chart.&lt;/P&gt;

&lt;P&gt;x-axis represents the age of the order [currentdate -order_date =age]. &lt;BR /&gt;
And each of the stacked bar represents sum(OrderAmount) of ordertype1 + sum(OrderAmount) of ordertype2 + sum(OrderAmount) of ordertype3&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;                       ordtyp1$tot  ordtyp2$tot ordtyp$tot
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;7 days late     ,            425            200         99&lt;BR /&gt;&lt;BR /&gt;
7 &amp;amp; 14 days late     ,           325            300         10&lt;BR /&gt;&lt;BR /&gt;
14 &amp;amp;  21 days late    ,          100            700         20&lt;BR /&gt;&lt;BR /&gt;
21 days late           ,         150            300         30    &lt;/P&gt;

&lt;P&gt;1st stacked bar will be summation of these 3 $ amounts[425+200+99]&lt;BR /&gt;
2nd stacked bar will be summation of these 3 $ amounts[325+300+10] &lt;BR /&gt;
3rd stacked bar will be summation of these 3 $ amounts[100+700+20] &lt;BR /&gt;
4th stacked bar will be summation of these 3 $ amounts[150+300+30] &lt;/P&gt;

&lt;P&gt;----x-axis----------  represents 7 days late , 7 &amp;amp;14 days late and so on &lt;/P&gt;

&lt;P&gt;Can you guide me as to how this can be achieved&lt;/P&gt;

&lt;P&gt;I have used below search query , it gives the half the solution , i am not able to stack the $ amounts.&lt;/P&gt;

&lt;P&gt;Here is the search query which i have used...&lt;/P&gt;

&lt;P&gt;index=index1 OR index=index2 OR index = index3 &lt;BR /&gt;
| fields ORDDATE,ORDDATE,ORDDATE,ORDERTOTAL,ORDERTOTAL,ORDERTOTAL,index&lt;BR /&gt;
| eval fldNow=now()&lt;BR /&gt;
| eval orderlinedate=strptime(substr(ORDDATE,1,8), "%Y%m%d")  | eval age=((orderlinedate-fldNow)/60)/60/24&lt;BR /&gt;&lt;BR /&gt;
| eval age_group=case(age&amp;gt;-8 AND age&amp;lt;0,"Stale BO Less than 7 days late",age&amp;gt;-15 AND age&amp;lt;-7,"Stale BO between 7 and 14 days late",age&amp;gt;-22 AND age&amp;lt;-14,"Stale BO between 14 and 21 days late",age&amp;lt;-21 ,"Stale BO more than 21 days late")&lt;BR /&gt;
| eval orderlinedate1=strptime(substr(ORDDATE,1,8), "%Y%m%d") | eval age1=((orderlinedate1-fldNow)/60)/60/24 &lt;BR /&gt;
| eval age_group1=case(age1&amp;gt;-8 AND age1&amp;lt;0,"Stale BO Less than 7 days late",age1&amp;gt;-15 AND age1&amp;lt;-7,"Stale BO between 7 and 14 days late",age1&amp;gt;-22 AND age1&amp;lt;-14,"Stale BO between 14 and 21 days late",age1&amp;lt;-21 ,"Stale BO more than 21 days late")&lt;BR /&gt;
| eval orderlinedate2=strptime(substr(ORDDATE,1,8), "%Y%m%d") | eval age2=((orderlinedate2-fldNow)/60)/60/24 &lt;BR /&gt;
| eval age_group2=case(age2&amp;gt;-8 AND age2&amp;lt;0,"Stale BO Less than 7 days late",age2&amp;gt;-15 AND age2&amp;lt;-7,"Stale BO between 7 and 14 days late",age2&amp;gt;-22 AND age2&amp;lt;-14,"Stale BO between 14 and 21 days late",age2&amp;lt;-21 ,"Stale BO more than 21 days late")&lt;BR /&gt;&lt;BR /&gt;
| stats sum(ORDERTOTAL) by age_group&lt;/P&gt;

&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129171#M44407</guid>
      <dc:creator>nekbote</dc:creator>
      <dc:date>2020-09-28T19:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked bar graph using data across multiple indexes</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129172#M44408</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;Any suggestions on how to get this done?  Any idea is appreciated...thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 16:35:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129172#M44408</guid>
      <dc:creator>nekbote</dc:creator>
      <dc:date>2015-04-07T16:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked bar graph using data across multiple indexes</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129173#M44409</link>
      <description>&lt;P&gt;I'm not entirely sure what you're asking... Are you wanting for each time bucket, a stacked bar graph where each bar is a particular age, and a particular segment is the sum from an individual index?&lt;/P&gt;

&lt;P&gt;Also what does _time on each event represent? Is it ORDDATE or is it something else?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:00:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129173#M44409</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-04-07T17:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked bar graph using data across multiple indexes</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129174#M44410</link>
      <description>&lt;P&gt;If I'm correct as to what you're asking, it may be as simple as instead of using stats using &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/chart"&gt;chart&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart sum(ORDERTOTAL) over age_group by index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129174#M44410</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-04-07T17:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked bar graph using data across multiple indexes</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129175#M44411</link>
      <description>&lt;P&gt;Hi acharlieh,&lt;/P&gt;

&lt;P&gt;"&lt;BR /&gt;
Are you wanting for each time bucket, a stacked bar graph where each bar is a particular age, and a particular segment is the sum from an individual index?&lt;BR /&gt;
"&lt;BR /&gt;
yes you are right , each of the segment in the bar graph is the sum from individual index.  &lt;/P&gt;

&lt;P&gt;_time is the time at which event is indexed, in my specific case almost all of the events are indexed once a day between 12 am -12:05 am PST everyday.&lt;/P&gt;

&lt;P&gt;On the x-axis in the graph , i am using the age=ORDDATE-CURRENTSYSDATE  to bucket the events into 4 buckets as listed in my search query.&lt;/P&gt;

&lt;P&gt;I have sample graph of what i need but i do not have enough karma points to post the picture.&lt;/P&gt;

&lt;P&gt;Let me know if you need more information.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129175#M44411</guid>
      <dc:creator>nekbote</dc:creator>
      <dc:date>2015-04-07T17:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked bar graph using data across multiple indexes</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129176#M44412</link>
      <description>&lt;P&gt;Hi acharlieh,&lt;/P&gt;

&lt;P&gt;You are bang on ...that worked ....thank you so much....you saved my day...thank you again!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:13:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Stacked-bar-graph-using-data-across-multiple-indexes/m-p/129176#M44412</guid>
      <dc:creator>nekbote</dc:creator>
      <dc:date>2015-04-07T17:13:37Z</dc:date>
    </item>
  </channel>
</rss>

