<?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 Coloring column dynamically based on all the results for a given column in a given search (AKA Conditional Formatting) in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Coloring-column-dynamically-based-on-all-the-results-for-a-given/m-p/465690#M45581</link>
    <description>&lt;P&gt;I’m trying to apply a color logic to a specific column in a table by range and thresholds. &lt;BR /&gt;
I have 1000 rows in that table, with 10 rows presented in each page. &lt;BR /&gt;
The range of colors should be the same for &lt;STRONG&gt;all&lt;/STRONG&gt; the values in the table, not only those that are presented in the current page.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8993i8AF18134DD0AC23A/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;As suggested here I tried using the following method:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;format type="color" field="kw_blocks / total_kw_blocks"&amp;gt;
          &amp;lt;colorPalette type="list"&amp;gt;[#DC4E41,#F8BE34,#53A051]&amp;lt;/colorPalette&amp;gt;
          &amp;lt;scale type="threshold"&amp;gt;33,66&amp;lt;/scale&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="kw_blocks / total_kw_blocks"&amp;gt;
          &amp;lt;option name="unit"&amp;gt;%&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only issue in this solution is that it uses constant thresholds:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;scale type="threshold"&amp;gt;33,66&amp;lt;/scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However In my case I don't know in advance what will be the max value and therefore I am getting it from the query search dynamically. Therefore I would like the thresholds to be percentile of this value.&lt;BR /&gt;
It will look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;scale type="threshold"&amp;gt;0.33*Max(kw_blocks / total_kw_blocks),0.66*Max(kw_blocks / total_kw_blocks)&amp;lt;/scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any idea how to do it?&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2020 17:55:31 GMT</pubDate>
    <dc:creator>nitzan_b</dc:creator>
    <dc:date>2020-05-27T17:55:31Z</dc:date>
    <item>
      <title>Coloring column dynamically based on all the results for a given column in a given search (AKA Conditional Formatting)</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Coloring-column-dynamically-based-on-all-the-results-for-a-given/m-p/465690#M45581</link>
      <description>&lt;P&gt;I’m trying to apply a color logic to a specific column in a table by range and thresholds. &lt;BR /&gt;
I have 1000 rows in that table, with 10 rows presented in each page. &lt;BR /&gt;
The range of colors should be the same for &lt;STRONG&gt;all&lt;/STRONG&gt; the values in the table, not only those that are presented in the current page.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8993i8AF18134DD0AC23A/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;As suggested here I tried using the following method:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;format type="color" field="kw_blocks / total_kw_blocks"&amp;gt;
          &amp;lt;colorPalette type="list"&amp;gt;[#DC4E41,#F8BE34,#53A051]&amp;lt;/colorPalette&amp;gt;
          &amp;lt;scale type="threshold"&amp;gt;33,66&amp;lt;/scale&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="kw_blocks / total_kw_blocks"&amp;gt;
          &amp;lt;option name="unit"&amp;gt;%&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only issue in this solution is that it uses constant thresholds:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;scale type="threshold"&amp;gt;33,66&amp;lt;/scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However In my case I don't know in advance what will be the max value and therefore I am getting it from the query search dynamically. Therefore I would like the thresholds to be percentile of this value.&lt;BR /&gt;
It will look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;scale type="threshold"&amp;gt;0.33*Max(kw_blocks / total_kw_blocks),0.66*Max(kw_blocks / total_kw_blocks)&amp;lt;/scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any idea how to do it?&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 17:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Coloring-column-dynamically-based-on-all-the-results-for-a-given/m-p/465690#M45581</guid>
      <dc:creator>nitzan_b</dc:creator>
      <dc:date>2020-05-27T17:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Coloring column dynamically based on all the results for a given column in a given search (AKA Conditional Formatting)</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Coloring-column-dynamically-based-on-all-the-results-for-a-given/m-p/465691#M45582</link>
      <description>&lt;P&gt;@nitzan_b what is the logic that you need to apply for table cell color palette? If it is based on Range have you tried &lt;CODE&gt;threshold&lt;/CODE&gt; based &lt;CODE&gt;colorPalette&lt;/CODE&gt;? Following is an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;format type="color" field="data"&amp;gt;
      &amp;lt;colorPalette type="list"&amp;gt;[#53A051,#B6C75A,#006D9C,#62B3B2,#F8BE34,#EC9960,#F1813F,#DC4E41]&amp;lt;/colorPalette&amp;gt;
      &amp;lt;scale type="threshold"&amp;gt;0,20,40,60,80,90,95&amp;lt;/scale&amp;gt;
    &amp;lt;/format&amp;gt;
    &amp;lt;format type="number" field="data"&amp;gt;
      &amp;lt;option name="unit"&amp;gt;%&amp;lt;/option&amp;gt;
    &amp;lt;/format&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the logic is different and not covered by any of mechanism provided in Splunk Documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML#Color_palette_types_and_options"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML#Color_palette_types_and_options&lt;/A&gt;, then, please add details for the community to assist!&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 19:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Coloring-column-dynamically-based-on-all-the-results-for-a-given/m-p/465691#M45582</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-05-27T19:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Coloring column dynamically based on all the results for a given column in a given search (AKA Conditional Formatting)</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Coloring-column-dynamically-based-on-all-the-results-for-a-given/m-p/465692#M45583</link>
      <description>&lt;P&gt;@niketnilay the solution you suggested is exactly what I need. &lt;BR /&gt;
However when using threshold based colorPalette the problem is that I need to define constant thresholds:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;scale type="threshold"&amp;gt;0,20,40,60,80,90,95&amp;lt;/scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In my case I don't know in advance what will be the max value. I am getting it from the query dynamically.  Therefore I would like the thresholds to be percentile of this value. &lt;BR /&gt;
It will look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;scale type="threshold"&amp;gt;0.33*MaxData,0.66*MaxData&amp;lt;/scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this doable? &lt;BR /&gt;
I also tried to calculate these values in the query itself:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats max(data) as MaxValueColoring
| eval 33Precentile=0.33*MaxValueColoring, 66Precentile=0.66*MaxValueColoring
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then pass them as the thresholds values but this is not working either: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;scale type="threshold"&amp;gt;33Precentile,66Precentile&amp;lt;/scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 May 2020 07:44:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Coloring-column-dynamically-based-on-all-the-results-for-a-given/m-p/465692#M45583</guid>
      <dc:creator>nitzan_b</dc:creator>
      <dc:date>2020-05-28T07:44:05Z</dc:date>
    </item>
  </channel>
</rss>

