I have header panels on a dashboard. Say this dropdown has a token called tok_panel. Is there a way to make the panels depend on specific values of tok_panel?
i.e., if I select "All" in the dropdown, only panel "All" should be visible instead of *. In my case i'm using Static options for all to display. Others options coming based on |stats c by field name.
@gcusello @ITWhisperer @PickleRick @richgalloway
Please share the source of your dashboard in a code block
<input token="panel_tok" searchWhenChanged="true">
<label>Vendor</label>
<choice value="*">All</choice>
<default>*</default>
<initialValue>*</initialValue>
<fieldForLabel>vendor</fieldForLabel>
<fieldForValue>vendor</fieldForValue>
<search>
<query>
|stats c by vendor
</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
Try something like this
<form version="1.1" theme="light">
<label>Hidden panels</label>
<fieldset submitButton="false">
<input type="dropdown" token="panel_tok" searchWhenChanged="true">
<label>Vendor</label>
<choice value="All">All</choice>
<default>All</default>
<initialValue>All</initialValue>
<fieldForLabel>Vendor</fieldForLabel>
<fieldForValue>Vendor</fieldForValue>
<search>
<query>| makeresults format=csv data="Vendor
Vendor A
Vendor B"
|stats c by Vendor</query>
<earliest>-7d@h</earliest>
<latest>now</latest>
</search>
<change>
<condition value="All">
<set token="vendorA">true</set>
<set token="vendorB">true</set>
</condition>
<condition value="Vendor A">
<set token="vendorA"></set>
<unset token="vendorB"></unset>
</condition>
<condition value="Vendor B">
<unset token="vendorA"></unset>
<set token="vendorB"></set>
</condition>
</change>
</input>
</fieldset>
<row>
<panel depends="$vendorA$">
<html>
<p>Panel A</p>
</html>
</panel>
</row>
<row>
<panel depends="$vendorB$">
<html>
<p>Panel B</p>
</html>
</panel>
</row>
</form>
hi @ITWhisperer it doesn't work.
I've tried something like this using Appendpipe command. I can see results.
For eg:
Vendor-1 10
Vendor-2 10
All 20
|inputlookup filename.csv
| stats count by Vendor
| appendpipe
[| stats sum(count) as count
| eval Vendor="All"]
But when I select All from drop-down, values are not showing in the single value. However when I select Vendor-1 values are displayed. How to fix this issue?
OK a bit random - why have you used appendpipe?
@ITWhisperer I just tired if we can use appendpipe it will the give the sum of both values. But it does not work. When i select All it should show all instead of star and corresponding values. I'm having only one header.