Dashboards & Visualizations

How to divide two single value panels and retrieve the value in the third single pannel?

Ragate
Explorer

I currently am building a dashboard and want to take two of my single value pannels results and divide them. I want this result to show in the third pannel. This is what I have:

<form>
  <label>Customer Stats. Clone</label>
  <fieldset submitButton="false" autoRun="true">
    <input type="dropdown" token="account_drop" searchWhenChanged="true">
      <label>Account Name</label>
      <fieldForLabel>Account Name</fieldForLabel>
      <fieldForValue>Account Name</fieldForValue>
      <search>
        <query>source="LMCustomerRevLicense.csv" | dedup "Account Name" |</query>
        <earliest>0</earliest>
        <latest></latest>
      </search>
    </input>
    <input type="text" token="field1">
      <label>License Key</label>
      <default></default>
    </input>
  </fieldset>
  <row>
    <panel>
      <single>
        <title>License Key</title>
        <search>
          <query>source="LMCustomerRevLicense.csv" $account_drop$ | dedup "Account Name" | table "License Key Identifier"</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="drilldown">none</option>
        <option name="height">116</option>
        <option name="refresh.display">progressbar</option>
      </single>
    </panel>
  </row>
  <row>
    <panel>
      <single>
        <title>Total Annual Revenue</title>
        <search>
          <query>source="LMCustomerRevLicense.csv" $account_drop$ | dedup "Account Name" | table "Total Active Subscription Revenue _converted"</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </single>
    </panel>
    <panel>
      <single>
        <title>Documents Processed</title>
        <search>
          <query>source="c:\\users\\ragate\\desktop\\splunk\\jsondump.txt" OR source="LMCustomerRevLicense1.csv" $field1$ | eval "LicenseKeyID"=substr('context.custom.dimensions{}.LicenseKey' ,4,7) | eval LicenseKeyID= coalesce(LicenseKeyID, 'License Key Identifier') | table "LicenseKeyID" "Account Name" "context.custom.dimensions{}.DocumentSessionId" | stats distinct_count("context.custom.dimensions{}.DocumentSessionId")</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </single>
    </panel>
  </row>
  <row>
    <panel>
      <single>
        <title>Documents per $</title>
        <search>
          <query></query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </single>
    </panel>
  </row>
  <row>
    <panel>
      <title>Distinct Users</title>
      <chart>
        <search>
          <query>host="ragate-lt1" $field1$ | chart count by context.user.anonId</query>
          <earliest>1529280000</earliest>
          <latest>1529539200</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">bar</option>
        <option name="refresh.display">progressbar</option>
      </chart>
    </panel>
    <panel>
      <title>Distinct Sessions</title>
      <chart>
        <search>
          <query>sourcetype="jsondump" $field1$ | top limit=20 "context.session.id"</query>
          <earliest>1529280000</earliest>
          <latest>1529539200</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">bar</option>
        <option name="charting.drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </chart>
    </panel>
  </row>
</form>

I would like to divide the Total Annual Revenue by the Documents Processed and have this result show up in the Documents per $.
Anyone know how this could be done.
Thanks in advance.

0 Karma

niketn
Legend

@Ragate, refer to my previous answer for two approach to solve this issue of having two single value panels and use their values to show result in 3rd Single value.

https://answers.splunk.com/answers/613939/how-to-calculate-percentage-based-on-2-different-s.html

Please adjust to your need and confirm. If you need further assistance, kindly let us know!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...