<?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 Re: Why is selectFirstChoice selecting an incorrect default value for my drop-down list? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216432#M13504</link>
    <description>&lt;P&gt;Thanks both for your answers. However, this morning I was going to try the 'num....' answer and the problem had disappeared!&lt;/P&gt;

&lt;P&gt;Don't understand because I worked on this for mulitple hours and did numerous refreshes. I think I didn't do a browser stop/start. May be Splunk has 'some caching remnants' that disappear after restart/reboot.&lt;/P&gt;

&lt;P&gt;Thanks anyway for your help! &lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2016 05:19:19 GMT</pubDate>
    <dc:creator>ewijkmr</dc:creator>
    <dc:date>2016-06-23T05:19:19Z</dc:date>
    <item>
      <title>Why is selectFirstChoice selecting an incorrect default value for my drop-down list?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216429#M13501</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I use the following search to dynamically populate a drop-down list. However, the default value selected is not in the resulting top-10 table at all. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;input type="dropdown" token="jobname" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;Select Jobname from Top-10&amp;lt;/label&amp;gt;
        &amp;lt;populatingSearch fieldForValue="JOBNAME" fieldForLabel="JOBNAME" earliest="-30d@d" latest="now"&amp;gt;
           &amp;lt;![CDATA[sourcetype=sapsr3_tbtc_1* | eval startmoment=strptime(STRTDATE." ".STRTTIME,"%Y%m%d %H%M%S"), eindmoment=strptime(ENDDATE." ".ENDTIME,"%Y%m%d %H%M%S"), runtime=eindmoment-startmoment | stats sum(runtime) by  JOBNAME | sort -sum(runtime) | head 10 | table JOBNAME]]&amp;gt;
        &amp;lt;/populatingSearch&amp;gt;        
        &amp;lt;selectFirstChoice&amp;gt;true&amp;lt;/selectFirstChoice&amp;gt;
      &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Running the search as a normal search shows that the selected value is the one at the top of the table before the &lt;CODE&gt;head 10&lt;/CODE&gt; and may be even before the &lt;CODE&gt;sort sum.....&lt;/CODE&gt; has been applied. My guess is that Splunk is applying the selectFirstChoice to intermediate and not the end result of the search. I.e. ZFIU_REVERSE_SDD_PO is the selected value by selectFirstChoice, but is not part of the top-10 drop-down list.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/141216-top-10.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Any thoughts anyone?&lt;/P&gt;

&lt;P&gt;Thanks a bunch!&lt;/P&gt;

&lt;P&gt;btw Splunk 6.4.1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:59:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216429#M13501</guid>
      <dc:creator>ewijkmr</dc:creator>
      <dc:date>2020-09-29T09:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why is selectFirstChoice selecting an incorrect default value for my drop-down list?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216430#M13502</link>
      <description>&lt;P&gt;Did you try sorting by JOBNAME at the end of the populating seach? Just a thought.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 18:31:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216430#M13502</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2016-06-22T18:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why is selectFirstChoice selecting an incorrect default value for my drop-down list?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216431#M13503</link>
      <description>&lt;P&gt;Try using this query for your dropdown&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=sapsr3_tbtc_1* | eval startmoment=strptime(STRTDATE." ".STRTTIME,"%Y%m%d %H%M%S"), eindmoment=strptime(ENDDATE." ".ENDTIME,"%Y%m%d %H%M%S"), runtime=eindmoment-startmoment | stats sum(runtime) as runtime by  JOBNAME | sort -num(runtime) | head 10 | table JOBNAME
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 19:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216431#M13503</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-22T19:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why is selectFirstChoice selecting an incorrect default value for my drop-down list?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216432#M13504</link>
      <description>&lt;P&gt;Thanks both for your answers. However, this morning I was going to try the 'num....' answer and the problem had disappeared!&lt;/P&gt;

&lt;P&gt;Don't understand because I worked on this for mulitple hours and did numerous refreshes. I think I didn't do a browser stop/start. May be Splunk has 'some caching remnants' that disappear after restart/reboot.&lt;/P&gt;

&lt;P&gt;Thanks anyway for your help! &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 05:19:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-selectFirstChoice-selecting-an-incorrect-default-value/m-p/216432#M13504</guid>
      <dc:creator>ewijkmr</dc:creator>
      <dc:date>2016-06-23T05:19:19Z</dc:date>
    </item>
  </channel>
</rss>

