<?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: Get variable to update when Null values is selected in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2414155#M94934</link>
    <description>&lt;P&gt;I submitted this improvement idea to qlik:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://ideation.qlik.com/app/#/case/365819?currentProductId=9da99bc1-0dfb-4471-8e12-d23685578c43" target="_blank"&gt;https://ideation.qlik.com/app/#/case/365819?currentProductId=9da99bc1-0dfb-4471-8e12-d23685578c43&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Feb 2024 18:07:23 GMT</pubDate>
    <dc:creator>shansen</dc:creator>
    <dc:date>2024-02-02T18:07:23Z</dc:date>
    <item>
      <title>Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2411541#M94663</link>
      <description>&lt;P&gt;&lt;SPAN&gt;A lot of this description won't make much sense until you open the qvf file I am attaching.&amp;nbsp; Basically, I cannot get a Variable to set and display properly when it is populated from a selected value in a field, and that value is NULL.&amp;nbsp; Does anyone know how to do this?&amp;nbsp; I have been trying NullAsValue as a work-around, but haven't been able to get that to work yet either.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Here is more detail:&lt;BR /&gt;&lt;SPAN&gt;Problem 1: Click on a value in one of the tables, then click "Set vMy...Var to Selected My... Value". This works fine as long as you select a populated value. However if you select only the Null value in one of the tables, and then click "Set vMy...Var to Selected My... Value", then the value does not update.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem 2: When the "Set vMy...Var to Null" button is pressed, it shows First char code: 45 ('-'), rather than 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Both of these should populate the variable the way "vMy...Var Variable Input" does when the user selects a Null value. It should result in First char code: 0 (Null value). Is there a workaround for this? I need them to work this way so I can do the What-If Scenario Analysis shown here when my dataset has Null values. If I send anything else but Null() (Char code: 0) to get a real-time prediction, then the probability is altered. Problem 2 I can get around by sending Null() to the the ScriptEvalEx() function when the variable's value is '-'. However, Problem 1 makes it so the variable simply doesn't update when it should. Is there any way to force it to update when a Null value gets selected?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 20:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2411541#M94663</guid>
      <dc:creator>shansen</dc:creator>
      <dc:date>2024-01-26T20:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2411670#M94674</link>
      <description>&lt;P&gt;I think you are confusion Null and Blank values. They are two different things. Null is a true missing value and it is represented in display by the character "-". Blank is a string with length of zero and it displays as "".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the same behavior, change your "Set to Null" button actions to set the value ="" instead of =Null().&lt;/P&gt;
&lt;P&gt;For more info see&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Member-Articles/NULL-handling-in-QlikView/ta-p/1484472" target="_blank"&gt;https://community.qlik.com/t5/Member-Articles/NULL-handling-in-QlikView/ta-p/1484472&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2024 16:55:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2411670#M94674</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2024-01-28T16:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2412129#M94716</link>
      <description>&lt;P&gt;Rob, Thanks for the reply.&lt;/P&gt;
&lt;P&gt;I understand the difference between Blank and Null.&amp;nbsp; That's not the real problem here.&amp;nbsp; In the end, the output shown in the text boxes is going to be passed to the ScriptEvalEx() function to get a real-time prediction from AutoML.&amp;nbsp; That function imputes values where Nulls exist, and does not impute values for Blank values.&amp;nbsp; So, the answer returned from AutoML is different.&amp;nbsp; It must have Null values sent to get the right answer.&amp;nbsp; However, I can handle exceptions in my formulas.&amp;nbsp; The real problem is that the variable won't update at all when a Null value is selected.&lt;/P&gt;
&lt;P&gt;The chain of widgets needed to make &lt;A href="https://community.qlik.com/t5/Design/Building-What-If-Scenarios-using-SSE-and-the-Qlik-AutoML/ba-p/1907221" target="_self"&gt;What-If Scenarios&lt;/A&gt; work is a bit more complex that what I show in the example Set Variable Test App.&amp;nbsp; A what-if sheet needs to allow the user to select a row in a feature table, update the values of variables based on that selection (hence the button), and then use Variable inputs to make custom modifications of those variables.&amp;nbsp; A production app with this process cannot break when there are Nulls in the dataset.&amp;nbsp; So, variables need to be able to update when there are Nulls.&lt;/P&gt;
&lt;P&gt;The "Set ... to Null" buttons in my example app may be worth emulating in one respect - at least they cause the variable to update.&amp;nbsp; Those are included for comparison.&amp;nbsp; However, the process I need to work is this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Select some non-Null value for MyString or MyNum.&amp;nbsp; Hit Set My...Var to Selected ... Value.&amp;nbsp; (It updates.)&lt;/LI&gt;
&lt;LI&gt;Have a Null value selected for MyString or MyNum.&amp;nbsp; Hit Set My...Var to Selected ... Value.&amp;nbsp; Have it update.&amp;nbsp; &lt;STRONG&gt;(This is the part not working right now.)&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;On step 2 the variable values could update to anything.&amp;nbsp; I could have it update to "NULL" for MyStr, and to -1 for MyNum.&amp;nbsp; Then when I pass the value in to the ScriptEvalEx() function, I could handle those cases and send a Null() to the function.&amp;nbsp; But I can't even get an action to update the variable's value when the source data has a Null value.&amp;nbsp; Another alternative might be to use NullAsValue in the data load script, to replace Nulls in the dataset with some value that would cause the variable to update, but I haven't been able to get that to work either.&amp;nbsp; Unfortunatly I have not found a workaround on this yet.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 17:46:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2412129#M94716</guid>
      <dc:creator>shansen</dc:creator>
      <dc:date>2024-01-29T17:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2412278#M94723</link>
      <description>&lt;P&gt;As you've suggested, you won't be able to pass a true null to ScriptEvalEx(). You will need to send a proxy like "NULL".&lt;/P&gt;
&lt;P&gt;In your step 2: "&lt;SPAN&gt;Have a Null value selected for MyString or MyNum"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How can a user select a Null value in Qlik?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-Rob&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 04:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2412278#M94723</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2024-01-30T04:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2412702#M94777</link>
      <description>&lt;P&gt;Rob,&lt;/P&gt;
&lt;P&gt;Yes, I can send a true Null to the ScriptEvalEx() function.&amp;nbsp; That is a recent development that Qlik just rolled out in response to one of my tickets to make the&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Design/Building-What-If-Scenarios-using-SSE-and-the-Qlik-AutoML/ba-p/1907221" target="_self"&gt;What-If Scenario&lt;/A&gt;&amp;nbsp;analysis work with production data.&amp;nbsp; It is the only way to get a real-time prediction to return the same probability that it did when the training dataset was run when there are Nulls.&amp;nbsp; It has to accept Null values, and impute the same mean and mode values that it learned from the training dataset in order to produce the same probability.&lt;/P&gt;
&lt;P&gt;To understand my step 2, it helps to have the Set Variable Test.qvf file open for reference. (I just realized that I did not make my Troubleshooting sheet public in the App.&amp;nbsp; Here it is again with that change.)&amp;nbsp; On the Troubleshooting sheet there are two Filter panes that show all the values available in the MyNum and MyString fields.&amp;nbsp; Before you can see that Step 2 doesn't work, you first need to do step 1: Select a non-Null value in one of those Filter panes, then hit the button above it labeled "&lt;SPAN&gt;Set My...Var to Selected ... Value".&amp;nbsp; &lt;/SPAN&gt;The text boxes on the right below the button show what would be passed to the ScriptEvalEx() function.&amp;nbsp; &lt;SPAN&gt;Now&lt;/SPAN&gt;&amp;nbsp;clear the selection in the green box at the top of the App.&amp;nbsp; Then for Step 2, select a blank value from either the MyNum or MyString Filter pane, and hit the&amp;nbsp;"&lt;SPAN&gt;Set My...Var to Selected ... Value" button above it.&amp;nbsp; You will see that the text at right does not update.&amp;nbsp; That is the problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 16:46:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2412702#M94777</guid>
      <dc:creator>shansen</dc:creator>
      <dc:date>2024-01-30T16:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2412833#M94790</link>
      <description>&lt;P&gt;I think it may be related to how we delete variables in script -- by setting the variable to '' or null().&amp;nbsp; Because of that meaning, there may be some restriction in setting a variable to one of those values in the UI. Interesting question to take back to Qlik.&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 03:50:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2412833#M94790</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2024-01-31T03:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2413181#M94832</link>
      <description>&lt;P&gt;Thanks for looking into it, Rob.&amp;nbsp; I know it is a complex issue.&amp;nbsp; I am just fishing for a workaround if it exists.&amp;nbsp; I will definitely coordinate with Qlik if not.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 16:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2413181#M94832</guid>
      <dc:creator>shansen</dc:creator>
      <dc:date>2024-01-31T16:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2413349#M94860</link>
      <description>&lt;P&gt;The only workaround I can think of is to use a placeholder like NULL in the data and then conditionally replace it with a null() in the ScriptEvalEx() expression.&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 04:58:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2413349#M94860</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2024-02-01T04:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2414151#M94933</link>
      <description>&lt;P&gt;I was able to get this to work, by doing lines like these in the Data load editor for each incoming numeric and string field:&lt;BR /&gt;Alt(Num(MyNum), Dual('NULL',-999)) AS MyNum,&lt;BR /&gt;If(MyString='', 'NULL', MyString) AS MyString&lt;/P&gt;
&lt;P&gt;The Num and Dual functions are how I helped Qlik recognize the MyNum field as numeric so the data type would match with what the ScriptEvalEx() function expects. This allows a button or other action to set a variable's value when the source data has a Null. Then in chart where the real-time prediction is used (Text &amp;amp; Image, KPI, table, etc.), I used a ScriptEvalEx() function call with the string and numeric variables passed in like this:&lt;/P&gt;
&lt;P&gt;endpoints.ScriptEvalEx('NS...','{"RequestType":"endpoint", "endpoint":{"connectionname":"&amp;lt;Space:ConnectionName&amp;gt;","column":"&amp;lt;Prediction Column Name&amp;gt;"}}',&lt;BR /&gt;vMyNum AS MyNum,&lt;BR /&gt;If(vMyString='NULL', Null(), vMyString) AS MyString,&lt;BR /&gt;...&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;Thanks for all your help Rob.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 17:37:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2414151#M94933</guid>
      <dc:creator>shansen</dc:creator>
      <dc:date>2024-02-02T17:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get variable to update when Null values is selected</title>
      <link>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2414155#M94934</link>
      <description>&lt;P&gt;I submitted this improvement idea to qlik:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://ideation.qlik.com/app/#/case/365819?currentProductId=9da99bc1-0dfb-4471-8e12-d23685578c43" target="_blank"&gt;https://ideation.qlik.com/app/#/case/365819?currentProductId=9da99bc1-0dfb-4471-8e12-d23685578c43&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 18:07:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-variable-to-update-when-Null-values-is-selected/m-p/2414155#M94934</guid>
      <dc:creator>shansen</dc:creator>
      <dc:date>2024-02-02T18:07:23Z</dc:date>
    </item>
  </channel>
</rss>

