<?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 set max y-axis value to a number derived from a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140658#M38888</link>
    <description>&lt;P&gt;Hardcoding the axis will not solve the issue. &lt;/P&gt;

&lt;P&gt;I need a to set a dynamic scale based on a search. &lt;/P&gt;

&lt;P&gt;Use case: customer requests two charts that he compares daily. He wants both charts to have the same axis so he can easily compare them.&lt;/P&gt;

&lt;P&gt;Option 1: combine the charts - this won't work; it makes the chart too busy and unreadable.&lt;BR /&gt;
Option 2: hard code the scale of both charts - this won't work because values range greatly from day-to-day or depending on the slicers selected. Therefore, one day the scale would be correct and the next day the chart would be nothing but white space.&lt;BR /&gt;
Option 3: have a dynamic scale based on a hidden search. This is what we are currently trying to do. create a search to find the max value from both charts and then set that value as the max on the y-axis for both charts.&lt;/P&gt;

&lt;P&gt;As far as I know, there is not a solution for this issue.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2015 16:39:57 GMT</pubDate>
    <dc:creator>cspires64</dc:creator>
    <dc:date>2015-06-24T16:39:57Z</dc:date>
    <item>
      <title>How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140654#M38884</link>
      <description>&lt;P&gt;I need to base the max y-axis value to the number created from a search . . . how do I do that? I looked at hidden searches and HiddenChartFormatter, but I can't get it work. I want to define the variable and set it in XML and then set the max y-axis value to the variable.&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
variable=@max set @max=|search . . . &lt;/P&gt;

&lt;P&gt;&amp;lt;option name="charting.axisY.maximumNumber"&amp;gt;@max&amp;lt;/option&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2015 22:27:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140654#M38884</guid>
      <dc:creator>cspires64</dc:creator>
      <dc:date>2015-06-02T22:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140655#M38885</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Could you please let me know if you had any luck with this problem. We have a similar need and would be great if someone can provide a solution or provide pointers for this.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 13:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140655#M38885</guid>
      <dc:creator>SwatiApte</dc:creator>
      <dc:date>2015-06-24T13:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140656#M38886</link>
      <description>&lt;P&gt;I am still unaware of a solution for this issue.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 15:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140656#M38886</guid>
      <dc:creator>cspires64</dc:creator>
      <dc:date>2015-06-24T15:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140657#M38887</link>
      <description>&lt;P&gt;Which chart are you trying? Is it for Bar Chart? if then, you need to apply on "axisX" .  Try hardcoding the @max value to test if it works. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="charting.axisX.maximumNumber"&amp;gt;2000&amp;lt;/option&amp;gt;
&amp;lt;option name="charting.axisTitleX.text"&amp;gt;axisTitleX TestName&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jun 2015 15:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140657#M38887</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2015-06-24T15:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140658#M38888</link>
      <description>&lt;P&gt;Hardcoding the axis will not solve the issue. &lt;/P&gt;

&lt;P&gt;I need a to set a dynamic scale based on a search. &lt;/P&gt;

&lt;P&gt;Use case: customer requests two charts that he compares daily. He wants both charts to have the same axis so he can easily compare them.&lt;/P&gt;

&lt;P&gt;Option 1: combine the charts - this won't work; it makes the chart too busy and unreadable.&lt;BR /&gt;
Option 2: hard code the scale of both charts - this won't work because values range greatly from day-to-day or depending on the slicers selected. Therefore, one day the scale would be correct and the next day the chart would be nothing but white space.&lt;BR /&gt;
Option 3: have a dynamic scale based on a hidden search. This is what we are currently trying to do. create a search to find the max value from both charts and then set that value as the max on the y-axis for both charts.&lt;/P&gt;

&lt;P&gt;As far as I know, there is not a solution for this issue.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 16:39:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140658#M38888</guid>
      <dc:creator>cspires64</dc:creator>
      <dc:date>2015-06-24T16:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140659#M38889</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can achieve this. First, create a hidden dropdown with dynamic options. Pass your query to calculate the maximum y-axis range from this. Now the dropdown token will have that max value. Then use that token, say max_count, as folows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="charting.axisY.maximumNumber"&amp;gt;$max_count$&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, the code will look like this (intentionally removed other options for better visibility):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;
    &amp;lt;input type="dropdown" token="max_count" searchWhenChanged="true" depends="$xyz$"&amp;gt; //any non-existing token for depends
      &amp;lt;label&amp;gt;Count&amp;lt;/label&amp;gt;
      &amp;lt;selectFirstChoice&amp;gt;true&amp;lt;/selectFirstChoice&amp;gt;
      &amp;lt;populatingSearch earliest="0" latest="" fieldForLabel="Count" fieldForValue="Count"&amp;gt;query&amp;lt;/populatingSearch&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;title&amp;gt;Title&amp;lt;/title&amp;gt;
        &amp;lt;searchString&amp;gt;query&amp;lt;/searchString&amp;gt;
        &amp;lt;earliestTime&amp;gt;$InputTime.earliest$&amp;lt;/earliestTime&amp;gt;
        &amp;lt;latestTime&amp;gt;$InputTime.latest$&amp;lt;/latestTime&amp;gt;
        &amp;lt;option name="charting.axisY.maximumNumber"&amp;gt;$max_count$&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps !!!!&lt;/P&gt;

&lt;P&gt;PS: Tested on Splunk 6.2+&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2015 09:13:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140659#M38889</guid>
      <dc:creator>chahal3108</dc:creator>
      <dc:date>2015-09-30T09:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140660#M38890</link>
      <description>&lt;P&gt;Hi chahal3108,&lt;/P&gt;

&lt;P&gt;How would you edit the populatingSearch so that you can use a token from a time range picker input on the form for the earliest and latest search parameters?  My max_count value needs to be based on a dynamic time range as opposed to a fixed time range.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 20:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140660#M38890</guid>
      <dc:creator>avisram</dc:creator>
      <dc:date>2016-04-05T20:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140661#M38891</link>
      <description>&lt;P&gt;Hi avsiram,&lt;/P&gt;

&lt;P&gt;You have earliest and latest available under populating search tag. Just pass your input time picker variable under those.&lt;BR /&gt;
e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;populatingSearch earliest="$InputTime.earliest$" latest="$InputTime.latest$" fieldForLabel="Count" fieldForValue="Count"&amp;gt;query&amp;lt;/populatingSearch&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Apr 2016 11:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140661#M38891</guid>
      <dc:creator>chahal3108</dc:creator>
      <dc:date>2016-04-07T11:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to set max y-axis value to a number derived from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140662#M38892</link>
      <description>&lt;P&gt;I was able to incorporate the time token directly into the query string.  This now works when the chart is initially displayed,  however when I change the time range from the picker the previous value is retained in the Count field with the updated value being displayed as a selection under from the drop-down.  I have "unset" the max_count token when the time range is changed however this has not resolved the issue.  Any further suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 15:42:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-max-y-axis-value-to-a-number-derived-from-a-search/m-p/140662#M38892</guid>
      <dc:creator>avisram</dc:creator>
      <dc:date>2016-04-07T15:42:19Z</dc:date>
    </item>
  </channel>
</rss>

