<?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: Subtracting time charts in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567201#M46580</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is producing results, but the difference is wrong&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 06:26:29 GMT</pubDate>
    <dc:creator>priyangshupal</dc:creator>
    <dc:date>2021-09-16T06:26:29Z</dc:date>
    <item>
      <title>Subtracting time charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567196#M46577</link>
      <description>&lt;P&gt;I have a timechart from the command&amp;nbsp;&lt;STRONG&gt;timechart span=1d count by skill1&amp;nbsp;&lt;/STRONG&gt;which looks like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE1&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE2&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE3&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;2021-09-15&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;77&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;243&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;17&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;2021-09-16&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;80&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;104&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;65&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;22&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And another timechart from the command&amp;nbsp;&lt;STRONG&gt;timechart span=1d count by skill2&amp;nbsp;&lt;/STRONG&gt;which looks like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE1&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE2&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE3&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;2021-09-15&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;70&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;200&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;10&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;2021-09-16&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;56&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;87&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;54&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a new timechart which should have skill1's values - skill2's values. As follows:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE1&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE2&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE3&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;VALUE4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;2021-09-15&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;7&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;43&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;7&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="25px"&gt;2021-09-16&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;14&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;17&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;11&lt;/TD&gt;&lt;TD width="20%" height="25px"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timechart span=1d count by skill1-skill2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it won't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on how to create the new timechart?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 05:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567196#M46577</guid>
      <dc:creator>priyangshupal</dc:creator>
      <dc:date>2021-09-16T05:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Subtracting time charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567199#M46578</link>
      <description>&lt;P&gt;You can do this type of timechart with eval and then calc the differences afterwards, but that my not work unless you know and can code in all the values of skill&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=1000
| eval _time=_time-(random() % 7)*86400
| eval skill1=mvindex(split("Value1,Value2,Value3,Value4",","), random() % 4)
| eval skill2=mvindex(split("Value1,Value2,Value3,Value4",","), random() % 4)
| timechart span=1d sum(eval(if(skill1="Value1", 1, 0))) as s1v1 sum(eval(if(skill1="Value2", 1, 0))) as s1v2 sum(eval(if(skill1="Value3", 1, 0))) as s1v3 sum(eval(if(skill1="Value4", 1, 0))) as s1v4 sum(eval(if(skill2="Value1", 1, 0))) as s2v1 sum(eval(if(skill2="Value2", 1, 0))) as s2v2 sum(eval(if(skill2="Value3", 1, 0))) as s2v3 sum(eval(if(skill2="Value4", 1, 0))) as s2v4
| eval v1=s1v1-s2v1, v2=s1v2-s2v2, v3=s1v3-s2v3, v4=s1v4-s2v4
| table _time v*&lt;/LI-CODE&gt;&lt;P&gt;Just paste in this to the search window&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 06:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567199#M46578</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-09-16T06:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subtracting time charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567200#M46579</link>
      <description>&lt;P&gt;Alternatively if you can share your data selection part of the search, it can probably be done using subsearches to join the two data sets together.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 06:05:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567200#M46579</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-09-16T06:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Subtracting time charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567201#M46580</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is producing results, but the difference is wrong&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 06:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Subtracting-time-charts/m-p/567201#M46580</guid>
      <dc:creator>priyangshupal</dc:creator>
      <dc:date>2021-09-16T06:26:29Z</dc:date>
    </item>
  </channel>
</rss>

