<?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: Create Variables from Fields in Load Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-Variables-from-Fields-in-Load-Script/m-p/1228481#M391741</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect your problem is in your listbox expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can load the fieldnames of interest into a single field like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Filters:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Filter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Dim1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Dim2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Dim3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your listbox, use &amp;lt;Expression&amp;gt; and define the expression as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(='[' &amp;amp; FieldValue('Filter',1) &amp;amp; ']')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would be for the first Filter, substitute "2" for "1" and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want all fields in the application, you don't need to create a Filter field, Instead you can use the system field $Field.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(='[' &amp;amp; FieldValue('$Field',1) &amp;amp; ']')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Feb 2017 23:13:32 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2017-02-20T23:13:32Z</dc:date>
    <item>
      <title>Create Variables from Fields in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Variables-from-Fields-in-Load-Script/m-p/1228480#M391740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a template I am creating in Qlikview. One tab will be called "filters" and I want to list out all possible fields in listboxes. (normally, I would right click select fields, highlight all and add them to the dashboard)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this will be a template, I would like to create listboxes under variable names and set those variables to fields in the edit script, so that once those variables are defined, the listboxes will show those field names and the data to select from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I have this script which I used from another post. However, in my listbox, I just see one paid amount (I know there are at least 800 different amounts) and the title of my listbox is one amount as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;SQL Select top 1000 *&lt;/P&gt;&lt;P&gt;FROM "databasename".dbo.tablename;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp:&lt;/P&gt;&lt;P&gt;Load DISTINCT( paid_amount) as FieldA&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let Variable1=Peek('FieldA',0,'tmp');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like the edit script to have my loaded table and then another load that renames all of the fields- for example&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;SQL &lt;SPAN style="font-size: 10pt;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Address&lt;/P&gt;&lt;P&gt;paid_amount&lt;/P&gt;&lt;P&gt;from xx.xxx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filters:&lt;/P&gt;&lt;P&gt;name as variable1&lt;/P&gt;&lt;P&gt;address as variable2&lt;/P&gt;&lt;P&gt;paid_amount as variable3&lt;/P&gt;&lt;P&gt;resident data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please help?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2017 21:45:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Variables-from-Fields-in-Load-Script/m-p/1228480#M391740</guid>
      <dc:creator />
      <dc:date>2017-02-20T21:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create Variables from Fields in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Variables-from-Fields-in-Load-Script/m-p/1228481#M391741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect your problem is in your listbox expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can load the fieldnames of interest into a single field like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Filters:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Filter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Dim1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Dim2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Dim3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your listbox, use &amp;lt;Expression&amp;gt; and define the expression as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(='[' &amp;amp; FieldValue('Filter',1) &amp;amp; ']')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would be for the first Filter, substitute "2" for "1" and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want all fields in the application, you don't need to create a Filter field, Instead you can use the system field $Field.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(='[' &amp;amp; FieldValue('$Field',1) &amp;amp; ']')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2017 23:13:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Variables-from-Fields-in-Load-Script/m-p/1228481#M391741</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2017-02-20T23:13:32Z</dc:date>
    </item>
  </channel>
</rss>

