<?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: Using a variable created in the load script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545046#M109800</link>
    <description>&lt;P&gt;You can assume string looks like&amp;nbsp;&lt;SPAN&gt;dimension_field§dimension_uilabel. The parsing works well with the variable that is defined in the app directly, but can't get it to work when creating the variable in the load script&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Mar 2026 10:12:43 GMT</pubDate>
    <dc:creator>johnnyjohn</dc:creator>
    <dc:date>2026-03-18T10:12:43Z</dc:date>
    <item>
      <title>Using a variable created in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545043#M109797</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable that i define in the app directly. Let's call the variable&amp;nbsp;v_DimensionToggle_Field for example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is created via the in-app variable panel, and set to "=SubField('$(v_DimensionToggle)', '§', 1)"&lt;/P&gt;&lt;P&gt;This works well, when the user selects a dimension, it correctly parses the string, and outputs the dimension to a chart, which then plots that dimension.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create this variable in the load script, not having any luck. I've tried things like&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set v_DimensionToggle_Field = =SubField('$(v_DimensionToggle)', '§', 1);&lt;/P&gt;&lt;P&gt;Set v_DimensionToggle_Field = =SubField($1, '§', 1); and using that with this in the chart =$(v_DimensionToggle_Field('$(v_DimensionToggle)'))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Can't seem to be able to create this variable I need directly in the load script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated !&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 09:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545043#M109797</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2026-03-18T09:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable created in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545045#M109799</link>
      <description>&lt;P&gt;All of these are using&amp;nbsp;v_DimensionToggle, but you haven't included the definition for that particular variable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 10:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545045#M109799</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2026-03-18T10:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable created in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545046#M109800</link>
      <description>&lt;P&gt;You can assume string looks like&amp;nbsp;&lt;SPAN&gt;dimension_field§dimension_uilabel. The parsing works well with the variable that is defined in the app directly, but can't get it to work when creating the variable in the load script&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 10:12:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545046#M109800</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2026-03-18T10:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable created in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545049#M109802</link>
      <description>&lt;P&gt;Based on that definition, your original attempt should work.&lt;/P&gt;&lt;P&gt;Set v_DimensionToggle_Field = =SubField('$(v_DimensionToggle)', '§', 1);&lt;/P&gt;&lt;P&gt;Front-end dimension:&lt;/P&gt;&lt;P&gt;=[$(v_DimensionToggle_Field)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script used to test:&lt;/P&gt;&lt;P&gt;Set v_DimensionToggle = 'dimension_field§dimension_uilabel';&lt;BR /&gt;Set v_DimensionToggle_Field = =SubField('$(v_DimensionToggle)', '§', 1);&lt;/P&gt;&lt;P&gt;Load '1' as dimension_field autogenerate(1);&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 10:26:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545049#M109802</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2026-03-18T10:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable created in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545052#M109804</link>
      <description>&lt;P&gt;It's odd. See below where I seem to be getting stuck. You can see v_test_var (created in app) is correctly evaluating the expression. You can see the v_DimensionToggle_Field is passed an empty value in the SubField function. I should mention the v_DimensionToggle is a variable that changes based on user input - it is not a static value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187351i29DC45093EFC511C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 10:33:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545052#M109804</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2026-03-18T10:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable created in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545058#M109809</link>
      <description>&lt;P&gt;Ah. If this variable isn't something you're providing in script, that definitely makes life trickier for script-side variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're going to have to either make it work with the parameterized version, or escape the dollar-sign expansion. Unfortunately, I'm not entirely sure what the exact method would be and do not have time to investigate right now. If I can, I will try and investigate further later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 10:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545058#M109809</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2026-03-18T10:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable created in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545059#M109810</link>
      <description>&lt;P&gt;Ok, if you get the chance to have a look at some point, it would get me out of a pickle ! Thanks a lot&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 11:02:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545059#M109810</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2026-03-18T11:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable created in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545067#M109814</link>
      <description>&lt;P&gt;You had the right idea with escaping the character - managed to do it like this. Thanks for the idea&lt;/P&gt;&lt;P&gt;Let v_DimensionToggle_Field = '=SubField(' &amp;amp; chr(39) &amp;amp; chr(36) &amp;amp; '(v_DimensionToggle)' &amp;amp; chr(39) &amp;amp; ', ' &amp;amp; chr(39) &amp;amp; '§' &amp;amp; chr(39) &amp;amp; ', 1)';&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 11:45:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-variable-created-in-the-load-script/m-p/2545067#M109814</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2026-03-18T11:45:28Z</dc:date>
    </item>
  </channel>
</rss>

