Dashboards & Visualizations

Adding additional value in Single Value Panel

leonheart78
Explorer

I have my XML code as below trying to show the COMM_AMT as a secondary value in the Single value panel. I have added the additional fields such as "field" and "changeField", but it does not reflect in my dashboard. May I know why?

<panel>
      <title>Top SELLER (PTE)</title>
      <single>
        <search>
          <query>index=transaction | table TSAC_NO, AGENT_NRIC, BIZ_NAME, MOBILE_NO, RANK_CODE, TEAM_NAME, PROPERTY, PROP_TYPE, TSAC_TYPE, COBROKE_AGENT, DATE_OPTION, DATE_SUBMIT, DATE_ENTER, DATE_INV, COMM_AMT | stats sum(COMM_AMT) as COMM_AMT by BIZ_NAME  | sort -COMM_AMT</query>
          <earliest>$field1.earliest$</earliest>
          <latest>$field1.latest$</latest>
        </search>
        <option name="field">BIZ_NAME</option>
        <option name="changeField">COMM_AMT</option>
        <option name="drilldown">none</option>
        <option name="colorBy">value</option>
        <option name="colorMode">none</option>
        <option name="numberPrecision">0</option>
        <option name="showSparkline">1</option>
        <option name="showTrendIndicator">1</option>
        <option name="trendColorInterpretation">standard</option>
        <option name="trendDisplayMode">absolute</option>
        <option name="unitPosition">after</option>
        <option name="useColors">0</option>
        <option name="useThousandSeparators">1</option>
        <option name="linkView">search</option>
      </single>
    </panel>
0 Karma
1 Solution

niketn
Legend

Since your stats is based on COMM_AMT and BIZ_RATE include them in your base search.
Following are some of the options to display multiple values in Single Value visualization.

Option 1

index=transaction COMM_AMT=* BIZ_NAME=*
| table TSAC_NO, AGENT_NRIC, BIZ_NAME, MOBILE_NO, RANK_CODE, TEAM_NAME, PROPERTY, PROP_TYPE, TSAC_TYPE, COBROKE_AGENT, DATE_OPTION, DATE_SUBMIT, DATE_ENTER, DATE_INV, COMM_AMT 
| stats sum(COMM_AMT) as COMM_AMT by BIZ_NAME 
| sort -COMM_AMT 
| eval NewField=BIZ_NAME + " - " + COMM_AMT 
| table NewField

Option 2
You can pass second stats field i.e. COMM_AMT as a taken by coding preview event of search and then use either unit or underLabel option in Simple XML to print the value.

  <single>
    <search>
      <query>    index=transaction COMM_AMT=* BIZ_NAME=*
                     | table TSAC_NO, AGENT_NRIC, BIZ_NAME, MOBILE_NO, RANK_CODE, TEAM_NAME, PROPERTY, PROP_TYPE, TSAC_TYPE, COBROKE_AGENT, DATE_OPTION, DATE_SUBMIT, DATE_ENTER, DATE_INV, COMM_AMT 
                     | stats sum(COMM_AMT) as COMM_AMT by BIZ_NAME 
                     | sort -COMM_AMT 
      </query>
      <earliest>-60m@m</earliest>
      <latest>now</latest>
      <sampleRatio>1</sampleRatio>
      <preview>
        <set token="commAMT">$result.COMM_AMT$</set>
      </preview>
    </search>
    <option name="colorBy">value</option>
    <option name="colorMode">none</option>
    <option name="drilldown">none</option>
    <option name="numberPrecision">0</option>
    <option name="showSparkline">1</option>
    <option name="showTrendIndicator">1</option>
    <option name="trendColorInterpretation">standard</option>
    <option name="trendDisplayMode">absolute</option>
    <option name="underLabel">- $commAMT$</option>
    <option name="unit">- $commAMT$</option>
    <option name="unitPosition">after</option>
    <option name="useColors">0</option>
    <option name="useThousandSeparators">1</option>
  </single>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

Since your stats is based on COMM_AMT and BIZ_RATE include them in your base search.
Following are some of the options to display multiple values in Single Value visualization.

Option 1

index=transaction COMM_AMT=* BIZ_NAME=*
| table TSAC_NO, AGENT_NRIC, BIZ_NAME, MOBILE_NO, RANK_CODE, TEAM_NAME, PROPERTY, PROP_TYPE, TSAC_TYPE, COBROKE_AGENT, DATE_OPTION, DATE_SUBMIT, DATE_ENTER, DATE_INV, COMM_AMT 
| stats sum(COMM_AMT) as COMM_AMT by BIZ_NAME 
| sort -COMM_AMT 
| eval NewField=BIZ_NAME + " - " + COMM_AMT 
| table NewField

Option 2
You can pass second stats field i.e. COMM_AMT as a taken by coding preview event of search and then use either unit or underLabel option in Simple XML to print the value.

  <single>
    <search>
      <query>    index=transaction COMM_AMT=* BIZ_NAME=*
                     | table TSAC_NO, AGENT_NRIC, BIZ_NAME, MOBILE_NO, RANK_CODE, TEAM_NAME, PROPERTY, PROP_TYPE, TSAC_TYPE, COBROKE_AGENT, DATE_OPTION, DATE_SUBMIT, DATE_ENTER, DATE_INV, COMM_AMT 
                     | stats sum(COMM_AMT) as COMM_AMT by BIZ_NAME 
                     | sort -COMM_AMT 
      </query>
      <earliest>-60m@m</earliest>
      <latest>now</latest>
      <sampleRatio>1</sampleRatio>
      <preview>
        <set token="commAMT">$result.COMM_AMT$</set>
      </preview>
    </search>
    <option name="colorBy">value</option>
    <option name="colorMode">none</option>
    <option name="drilldown">none</option>
    <option name="numberPrecision">0</option>
    <option name="showSparkline">1</option>
    <option name="showTrendIndicator">1</option>
    <option name="trendColorInterpretation">standard</option>
    <option name="trendDisplayMode">absolute</option>
    <option name="underLabel">- $commAMT$</option>
    <option name="unit">- $commAMT$</option>
    <option name="unitPosition">after</option>
    <option name="useColors">0</option>
    <option name="useThousandSeparators">1</option>
  </single>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...