<?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: Variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Variable/m-p/2462442#M98973</link>
    <description>&lt;P&gt;But, I want to use the value of XBREFNUM, which is selected from the user. That's why I use&amp;nbsp;&lt;SPAN&gt;GetFieldSelections&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2024 06:08:41 GMT</pubDate>
    <dc:creator>Frédéricdh</dc:creator>
    <dc:date>2024-06-14T06:08:41Z</dc:date>
    <item>
      <title>Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Variable/m-p/2462198#M98941</link>
      <description>&lt;P&gt;I define a variable like that BREF =GetFieldSelections(XBREFNUM)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and in the script I define like that&amp;nbsp;XBREFNUM = $(BREF)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but when i start a load from the script, the prog says i have an error because XBREFNUM =&amp;nbsp;GetFieldSelections(XBREFNUM)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That why in the script i wrote a condition on&amp;nbsp;$(BREF)&amp;nbsp; but it doesn't work&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 12:53:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable/m-p/2462198#M98941</guid>
      <dc:creator>Frédéricdh</dc:creator>
      <dc:date>2024-06-13T12:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Variable/m-p/2462263#M98951</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/204231"&gt;@Frédéricdh&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The GetFieldSelections() function is used in the UI part of Qlik Sense to retrieve the current selections of a field as a string. It cannot be used directly in the data load script because the script does not interact with the UI selections.&lt;/P&gt;
&lt;P&gt;If you want to use the value of a field selection within the script, you need to pass it as a parameter when the script is reloaded, which is typically done through an action in the UI, not directly in the script.&lt;/P&gt;
&lt;P&gt;Define the variable:&lt;/P&gt;
&lt;P&gt;SET BREF = 'YourStaticValue'; // Assigns a static value to BREF&lt;BR /&gt;LET BREF = Peek('FieldName', 0, 'TableName'); // Assigns the result of an expression to BREF&lt;/P&gt;
&lt;P&gt;Use the variable in the script:&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;Field1,&lt;BR /&gt;Field2,&lt;BR /&gt;$(BREF) as XBREFNUM&lt;BR /&gt;FROM DataSource;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;***Hope this resolve your issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the issue is solved please mark the answer with Accept as Solution &amp;amp; like it.***&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 14:46:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable/m-p/2462263#M98951</guid>
      <dc:creator>TauseefKhan</dc:creator>
      <dc:date>2024-06-13T14:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Variable/m-p/2462442#M98973</link>
      <description>&lt;P&gt;But, I want to use the value of XBREFNUM, which is selected from the user. That's why I use&amp;nbsp;&lt;SPAN&gt;GetFieldSelections&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 06:08:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable/m-p/2462442#M98973</guid>
      <dc:creator>Frédéricdh</dc:creator>
      <dc:date>2024-06-14T06:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Variable/m-p/2462539#M98981</link>
      <description>&lt;P&gt;I make an If statement in my script to overcome the problem, like that&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If $(BREF) = '= GetFieldSelections(XBREFNUM)' then&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but than I have this error message&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Syntax error&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Unexpected token: '=', expected one of: '(', 'Yellow', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', 'bitnot', ...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;=&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; GetFieldSelections(XBREFNUM) = '= GetFieldSelections(XBREFNUM)' then&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see how to overcome the problem.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 09:36:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable/m-p/2462539#M98981</guid>
      <dc:creator>Frédéricdh</dc:creator>
      <dc:date>2024-06-14T09:36:36Z</dc:date>
    </item>
  </channel>
</rss>

