<?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 How can I highlight table cells conditioned on a value? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-highlight-table-cells-conditioned-on-a-value/m-p/558105#M38820</link>
    <description>&lt;P&gt;I followed&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;'s syntax to produce a panel of table cells. My syntax is as follow:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Test2&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #highlight table tbody{
            display:flex;
            flex-wrap: wrap;
          }
          #highlight table tbody tr{
            margin-right:10px;
            margin-bottom:10px;
          }
          #highlight table tbody tr td{
            width: 180px;
            text-align: center;
          }
        &amp;lt;/style&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;div&amp;gt;Clicked Value in Cell (click.value):$click.value$&amp;lt;/div&amp;gt;
          &amp;lt;div&amp;gt;Clicked Cell Values (click.value2):$click.value2$&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;table id="highlight"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index="omap_heng"
| fields host reception Station 
| sort 0 +host
| search reception = *
| streamstats count by reception,host reset_on_change=true
| eval new_counter=if(reception == 1,0, count)
| table host new_counter Station
| streamstats max(new_counter) as max_counter by host 
| sort 0 +host, -max_counter
| streamstats first(max_counter) as max_counter by host
| where new_counter=max_counter
| table Station,max_counter
| eval "Max Counter Info"=Station."###".max_counter
| fields "Max Counter Info"
| makemv "Max Counter Info" delim="###"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;format type="color" field="Max Counter Info"&amp;gt;
          &amp;lt;colorPalette type="list"&amp;gt;[#53A051,#006D9C,#F1813F,#DC4E41]&amp;lt;/colorPalette&amp;gt;
          &amp;lt;scale type="threshold"&amp;gt;0,6,11&amp;lt;/scale&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="Max Counter Info"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;set token="click.value"&amp;gt;$click.value$&amp;lt;/set&amp;gt;
          &amp;lt;set token="click.value2"&amp;gt;$click.value2$&amp;lt;/set&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to highlight each cells, based on a range on max_counter value (the circled value in my image below). Hence, if my max_counter is between 0 and 6, then green, if between 7 and 11, then orange and if above 11, red.&lt;/P&gt;&lt;P&gt;My panel currently looks like this now:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cherylheng9586_0-1625208264660.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14917iC040F566FDE74247/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cherylheng9586_0-1625208264660.png" alt="cherylheng9586_0-1625208264660.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pls help! thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 06:44:38 GMT</pubDate>
    <dc:creator>cherylheng9586</dc:creator>
    <dc:date>2021-07-02T06:44:38Z</dc:date>
    <item>
      <title>How can I highlight table cells conditioned on a value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-highlight-table-cells-conditioned-on-a-value/m-p/558105#M38820</link>
      <description>&lt;P&gt;I followed&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;'s syntax to produce a panel of table cells. My syntax is as follow:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Test2&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #highlight table tbody{
            display:flex;
            flex-wrap: wrap;
          }
          #highlight table tbody tr{
            margin-right:10px;
            margin-bottom:10px;
          }
          #highlight table tbody tr td{
            width: 180px;
            text-align: center;
          }
        &amp;lt;/style&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;div&amp;gt;Clicked Value in Cell (click.value):$click.value$&amp;lt;/div&amp;gt;
          &amp;lt;div&amp;gt;Clicked Cell Values (click.value2):$click.value2$&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;table id="highlight"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index="omap_heng"
| fields host reception Station 
| sort 0 +host
| search reception = *
| streamstats count by reception,host reset_on_change=true
| eval new_counter=if(reception == 1,0, count)
| table host new_counter Station
| streamstats max(new_counter) as max_counter by host 
| sort 0 +host, -max_counter
| streamstats first(max_counter) as max_counter by host
| where new_counter=max_counter
| table Station,max_counter
| eval "Max Counter Info"=Station."###".max_counter
| fields "Max Counter Info"
| makemv "Max Counter Info" delim="###"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;format type="color" field="Max Counter Info"&amp;gt;
          &amp;lt;colorPalette type="list"&amp;gt;[#53A051,#006D9C,#F1813F,#DC4E41]&amp;lt;/colorPalette&amp;gt;
          &amp;lt;scale type="threshold"&amp;gt;0,6,11&amp;lt;/scale&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="Max Counter Info"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;set token="click.value"&amp;gt;$click.value$&amp;lt;/set&amp;gt;
          &amp;lt;set token="click.value2"&amp;gt;$click.value2$&amp;lt;/set&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to highlight each cells, based on a range on max_counter value (the circled value in my image below). Hence, if my max_counter is between 0 and 6, then green, if between 7 and 11, then orange and if above 11, red.&lt;/P&gt;&lt;P&gt;My panel currently looks like this now:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cherylheng9586_0-1625208264660.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14917iC040F566FDE74247/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cherylheng9586_0-1625208264660.png" alt="cherylheng9586_0-1625208264660.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pls help! thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 06:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-highlight-table-cells-conditioned-on-a-value/m-p/558105#M38820</guid>
      <dc:creator>cherylheng9586</dc:creator>
      <dc:date>2021-07-02T06:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I highlight table cells conditioned on a value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-highlight-table-cells-conditioned-on-a-value/m-p/558119#M38821</link>
      <description>&lt;P&gt;You could use a third value in your mv evaluated to the colour you want to use, then hide (display none) the value.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel depends="$stayhidden$"&amp;gt;
      &amp;lt;title&amp;gt;Colour based on previous&amp;lt;/title&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #highlight table tbody{
            display:flex;
            flex-wrap: wrap;
          }
          #highlight table tbody tr{
            margin-right:10px;
            margin-bottom:10px;
          }
          #highlight table tbody tr td{
            width: 180px;
            text-align: center;
          }
          #highlight table tbody td div.multivalue-subcell[data-mv-index="2"]{
            display: none;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel id="highlight"&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults 
| eval maxcounterinfo="8.0###6|8.0###7|8.0###11|8.0###12|8.0###19"
| eval maxcounterinfo=split(maxcounterinfo,"|")
| mvexpand maxcounterinfo
| makemv maxcounterinfo delim="###"
| eval maxcounterinfo=mvappend(maxcounterinfo,case(tonumber(mvindex(maxcounterinfo,1))&amp;amp;lt;7,"GREEN",tonumber(mvindex(maxcounterinfo,1))&amp;amp;lt;12,"ORANGE",true(),"RED"))
| table maxcounterinfo&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;format type="color"&amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;case (match(value,"RED"), "#ff0000",match(value,"ORANGE"), "#ff8000",match(value,"GREEN"),"#00ff00",true(),"#ffffff")&amp;lt;/colorPalette&amp;gt;
        &amp;lt;/format&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jul 2021 08:00:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-highlight-table-cells-conditioned-on-a-value/m-p/558119#M38821</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-02T08:00:48Z</dc:date>
    </item>
  </channel>
</rss>

