<?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 Generate script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089132#M89262</link>
    <description>&lt;P&gt;Is there a way to generate script from a variable ?&lt;/P&gt;
&lt;P&gt;case:&lt;/P&gt;
&lt;P&gt;field A contains 'load field1 as field_1'&lt;/P&gt;
&lt;P&gt;variable&amp;nbsp; = fieldvalue(fieldA)&lt;/P&gt;
&lt;P&gt;how do I get this in the script ? I tried&lt;/P&gt;
&lt;P&gt;$(variable)&amp;nbsp;&amp;nbsp;from table;&lt;/P&gt;
&lt;P&gt;but when loading this is the result:&lt;/P&gt;
&lt;P&gt;fieldvalue(fieldA)&amp;nbsp;&amp;nbsp;from table;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jun 2023 12:25:37 GMT</pubDate>
    <dc:creator>chris_br</dc:creator>
    <dc:date>2023-06-29T12:25:37Z</dc:date>
    <item>
      <title>Generate script</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089132#M89262</link>
      <description>&lt;P&gt;Is there a way to generate script from a variable ?&lt;/P&gt;
&lt;P&gt;case:&lt;/P&gt;
&lt;P&gt;field A contains 'load field1 as field_1'&lt;/P&gt;
&lt;P&gt;variable&amp;nbsp; = fieldvalue(fieldA)&lt;/P&gt;
&lt;P&gt;how do I get this in the script ? I tried&lt;/P&gt;
&lt;P&gt;$(variable)&amp;nbsp;&amp;nbsp;from table;&lt;/P&gt;
&lt;P&gt;but when loading this is the result:&lt;/P&gt;
&lt;P&gt;fieldvalue(fieldA)&amp;nbsp;&amp;nbsp;from table;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 12:25:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089132#M89262</guid>
      <dc:creator>chris_br</dc:creator>
      <dc:date>2023-06-29T12:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Generate script</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089142#M89263</link>
      <description>&lt;P&gt;This works fine:&lt;/P&gt;
&lt;P&gt;set SomeVariable = 'Load 1 as field autogenerate(1)';&lt;/P&gt;
&lt;P&gt;$(SomeVariable);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 12:50:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089142#M89263</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-06-29T12:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generate script</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089150#M89264</link>
      <description>&lt;P&gt;yes, it works when the variable is hardcoded.&lt;/P&gt;
&lt;P&gt;But in this case the field contains the script, and when I define the variable to read the fieldvalue, it doesnt put this in the script, only the definition of the variable.&lt;/P&gt;
&lt;P&gt;it puts '&lt;SPAN&gt;fieldvalue(fieldA)' iso 'load field1 as field_1'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 13:02:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089150#M89264</guid>
      <dc:creator>chris_br</dc:creator>
      <dc:date>2023-06-29T13:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Generate script</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089152#M89265</link>
      <description>&lt;P&gt;Sounds like you haven't defined your variable correctly, then... perhaps you used SET where you should have used LET? You didn't include the actual code so it's hard to say. &lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 13:04:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089152#M89265</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-06-29T13:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generate script</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089158#M89267</link>
      <description>&lt;P&gt;I've tried several ways.&lt;/P&gt;
&lt;DIV&gt;So I'm searching for the way to do it right&lt;/DIV&gt;
&lt;DIV&gt;do I use let or set, with = or not ?&lt;/DIV&gt;
&lt;DIV&gt;e.g.&lt;/DIV&gt;
&lt;DIV&gt;let&amp;nbsp;&lt;SPAN&gt;variable&amp;nbsp; = fieldvalue(fieldA);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;set&amp;nbsp;&lt;SPAN&gt;variable&amp;nbsp; = fieldvalue(fieldA);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;set&amp;nbsp;&lt;SPAN&gt;variable&amp;nbsp; = =fieldvalue(fieldA);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;or something else ?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Jun 2023 13:14:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089158#M89267</guid>
      <dc:creator>chris_br</dc:creator>
      <dc:date>2023-06-29T13:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Generate script</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089160#M89268</link>
      <description>&lt;P&gt;You would presumably use the first one.&lt;/P&gt;
&lt;P&gt;This works fine as well:&lt;/P&gt;
&lt;P&gt;Load * INLINE [&lt;BR /&gt;Field&lt;BR /&gt;Load 1 as field2 autogenerate(1)&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;Let SomeVariable = FieldValue('Field',1);&lt;/P&gt;
&lt;P&gt;$(SomeVariable);&lt;/P&gt;
&lt;P&gt;When doing this sort of thing, I'd recommend using debug mode to look at how the variables are getting populated and read.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 13:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089160#M89268</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-06-29T13:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generate script</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089171#M89269</link>
      <description>&lt;P&gt;By using field- or table-functions the names must be wrapped with single-quotes like:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;let&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;variable&amp;nbsp; = fieldvalue('fieldA'&lt;STRONG&gt;, 1&lt;/STRONG&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and the appropriate index-value must be specified.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Further the field-values mustn't be wrapped with any quotes but they must contain the appropriate quoting for values and field-names, like:&lt;/P&gt;
&lt;P&gt;load 'String' as [new field], FieldX as "FieldY"&lt;/P&gt;
&lt;P&gt;and then you could use it like you did:&lt;/P&gt;
&lt;P&gt;table: $(variable) from Source;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 13:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-script/m-p/2089171#M89269</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-06-29T13:28:41Z</dc:date>
    </item>
  </channel>
</rss>

