<?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: InputField values not returned from Lookup in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990638#M337552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that is true ... so you need to code some helper VBscript macros to administer these variables... and you can "emulate" arrays by adding an index number to each variable name. That way you can use $-sign expansion to reference the "array" values by index number or even by "names" if you like...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Nov 2015 16:47:32 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2015-11-26T16:47:32Z</dc:date>
    <item>
      <title>InputField values not returned from Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990635#M337549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My data has a number of vectors and I want to compute a linear combination of them.&amp;nbsp; Each vector has an ID and different values for each year, so my aggregation into a new ID (99) is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Data:&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concatenate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; 99 as ID,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; Year,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; Sum(Value*Factor) as Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group By Year;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the user to be able to set the factor for each ID so I created a Control table with fields (ID, UserFactor), making the UserFactor field of type InputField so it can be edited in the UI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the factors I put the ID into variable vID and use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lookup('UserFactor','ID',$(vID),'Control')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine if field UserFactor is NOT an InputField, but fails if it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Is this a restriction for InputField fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Is there a better way to allow users to enter data to be used in table processing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 13:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990635#M337549</guid>
      <dc:creator />
      <dc:date>2015-11-26T13:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: InputField values not returned from Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990636#M337550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;InputField has a lot of special restrictions that can make them a pain to use. I find using variables quite a bit more predictable and reliable. But the downside is that you have to do a bit more handling yourself of the creation and deletion of variables and it depends on the number of data values that you need to let the users modify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is the usage in your scenario? How much data need to be modified - a handful - some tens of data - hundreds or in the thousands?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it comes to InputField you also need to use special "Input Field Aggregation Functions" the normal ones will not do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't believe this if you look in the QlikView Reference Manual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;An input field is just like any other field in QlikView, with the difference that its values, as read in the&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;script, can later be changed without running the script again. Input fields can be used like any other fields in&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;all types of sheet objects.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is simply not true .... Input Fields ARE NOT as any other field in QlikView... I literally wasted several days in a project believing this before I just had to give up. Be prepared that they work in a weird manner with a lot of restrictions and suddenly something like a JOIN or CONCATENATE might break them...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 16:16:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990636#M337550</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-11-26T16:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: InputField values not returned from Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990637#M337551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In fact my problem is even stranger - the InputField Lookup works in a LOAD statement but not in an ADD LOAD statement.&amp;nbsp; But I need to use Partial Reloads to let the user perform a variety of operations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try using variables, but it's going to be messy if I have an arbitrary number of them!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 16:27:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990637#M337551</guid>
      <dc:creator />
      <dc:date>2015-11-26T16:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: InputField values not returned from Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990638#M337552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that is true ... so you need to code some helper VBscript macros to administer these variables... and you can "emulate" arrays by adding an index number to each variable name. That way you can use $-sign expansion to reference the "array" values by index number or even by "names" if you like...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 16:47:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990638#M337552</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-11-26T16:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: InputField values not returned from Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990639#M337553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rather than mess about with many variables I found a neat solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To recap, I have a table of (key,value) pairs displayed in the UI where the user types in the values and then a Partial Reload is used to process the data using these values.&amp;nbsp; But the "value" is an InputField and this does not survive a Partial Reload if it is referenced in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My workaround is to create a temporary table in the script, but instead of generating it directly from the parent table, the contents are saved in two variables which are then used in the LOAD statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The steps are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. User enters values into the MyValue fields for table Control(MyKey,MyValue) and then selects a button labeled "Do It"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The button has Actions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Set Variable vKeys=concat(MyKey,',',MyKey)&lt;/P&gt;&lt;P&gt;-- Set Variable vValues=concat(MyValue,',',MyKey)&lt;/P&gt;&lt;P&gt;-- Reload (Partial)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The third parameter in the concat() calls ensures that the two lists are in the same order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. The script creates a temporary table from the variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmpControl:&lt;/P&gt;&lt;P&gt;Replace LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField('$(vKeys)',',')as tmpKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField('$(vValues)',',',RowNo()) as tmpValue&lt;/P&gt;&lt;P&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first SubField function (with two parameters) creates one record for each Key, but the second SubField Function (with three parameters) provides just one value for each record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. The remainder of the script uses this temporary table instead of the original, which is now preserved in the UI and can be re-used at will.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I often find that the "obvious" implementation does not work in QlikView, but on this occasion there is an elegant (maybe!) solution, if a little obscure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 10:58:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/InputField-values-not-returned-from-Lookup/m-p/990639#M337553</guid>
      <dc:creator />
      <dc:date>2015-11-30T10:58:31Z</dc:date>
    </item>
  </channel>
</rss>

