<?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: Dashboard permits user date input -- why does my search for &amp;quot;isnull&amp;quot; display an error? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290874#M18453</link>
    <description>&lt;P&gt;Hey @kennethyeung, if they solved your problem, remember to "√Accept" an answer to award karma points &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 00:12:16 GMT</pubDate>
    <dc:creator>lfedak_splunk</dc:creator>
    <dc:date>2017-10-10T00:12:16Z</dc:date>
    <item>
      <title>Dashboard permits user date input -- why does my search for "isnull" display an error?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290872#M18451</link>
      <description>&lt;P&gt;I have a dashboard that allows users to choose Date and Month. via  drop down box: $t_Date$ and $t_Month$ (e.g 11 September)&lt;/P&gt;

&lt;P&gt;I have field is 11_September, 12_September and ...&lt;/P&gt;

&lt;P&gt;when I use table $t_Date$&lt;EM&gt;$t_Month$, I can display the table correctly.&lt;BR /&gt;
but if i want to check the field isnull or not &lt;BR /&gt;
eval tmp=if(isnull($t_Date$&lt;/EM&gt;$t_Month$),1,0), it will display error&lt;BR /&gt;
if i put the single or double quotation marks ' , it can display but the result is not what I expect.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290872#M18451</guid>
      <dc:creator>kennethyeung</dc:creator>
      <dc:date>2020-09-29T16:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard permits user date input -- why does my search for "isnull" display an error?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290873#M18452</link>
      <description>&lt;P&gt;@kennethyeung, if your intent is to set &lt;CODE&gt;tmp&lt;/CODE&gt; field only if both &lt;CODE&gt;Date&lt;/CODE&gt; and &lt;CODE&gt;Month&lt;/CODE&gt; dropdown have values selected, then you can code &lt;CODE&gt;&amp;lt;change&amp;gt;&lt;/CODE&gt; event handler to default the dropdown values to some exception values ( I have set to &lt;CODE&gt;99&lt;/CODE&gt; for Date and &lt;CODE&gt;Null&lt;/CODE&gt; for Month). The reason why is it required is that, since you are using these tokens in your search, your search will not run if token/s is/are set to &lt;CODE&gt;null&lt;/CODE&gt;. Then in the search if I find either &lt;CODE&gt;99_&lt;/CODE&gt; or &lt;CODE&gt;_Null&lt;/CODE&gt;, I am setting the &lt;CODE&gt;tmp&lt;/CODE&gt; field to 1. Else to 0. Please find below a run-anywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Combine Tokens as FieldName and Handle Null Values&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="ddDate"&amp;gt;
      &amp;lt;label&amp;gt;Select Date&amp;lt;/label&amp;gt;
      &amp;lt;choice value="11_"&amp;gt;11&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="12_"&amp;gt;12&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="t_Date"&amp;gt;if(isnull($value$),"99_",$value$)&amp;lt;/eval&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="ddMonth"&amp;gt;
      &amp;lt;label&amp;gt;Select Month&amp;lt;/label&amp;gt;
      &amp;lt;choice value="September"&amp;gt;September&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="October"&amp;gt;October&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="t_Month"&amp;gt;if(isnull($value$),"Null",$value$)&amp;lt;/eval&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults
          | eval $t_Date$$t_Month$="$t_Date$$t_Month$"
          | eval tmp=if(like('$t_Date$$t_Month$',"%Null") OR like('$t_Date$$t_Month$',"99_%"),1,0)
          | table $t_Date$$t_Month$ tmp
          &amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Oct 2017 07:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290873#M18452</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-09T07:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard permits user date input -- why does my search for "isnull" display an error?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290874#M18453</link>
      <description>&lt;P&gt;Hey @kennethyeung, if they solved your problem, remember to "√Accept" an answer to award karma points &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 00:12:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290874#M18453</guid>
      <dc:creator>lfedak_splunk</dc:creator>
      <dc:date>2017-10-10T00:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard permits user date input -- why does my search for "isnull" display an error?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290875#M18454</link>
      <description>&lt;P&gt;i found that, if use isnull, then it will say error,&lt;/P&gt;

&lt;P&gt;Like doesnt have this issue. not sure why&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 07:47:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290875#M18454</guid>
      <dc:creator>kennethyeung</dc:creator>
      <dc:date>2017-10-10T07:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard permits user date input -- why does my search for "isnull" display an error?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290876#M18455</link>
      <description>&lt;P&gt;@kennethyeung, if you use tokens in your search and then they can not be null or else search will not execute until the token values are provided ( &lt;CODE&gt;Search is waiting for input&lt;/CODE&gt; ).&lt;/P&gt;

&lt;P&gt;Hence to ensure that search always runs, you need to handle null values upfront. In this run anywhere dashboard I have done that in dropdown input's &lt;CODE&gt;&amp;lt;change&amp;gt;&lt;/CODE&gt; event handler and replaced with some text as default value.&lt;/P&gt;

&lt;P&gt;Later in the search, I have compared with default text rather than null values in the token. Please try out the run anywhere dashboard as it should help you understand and then translate for your use case. If there is any other issue, do give us the details on what code/data you have and what is the error.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 01:22:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-permits-user-date-input-why-does-my-search-for-quot/m-p/290876#M18455</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-11T01:22:36Z</dc:date>
    </item>
  </channel>
</rss>

