<?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: Load script: Define variable and assign an expression with set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797134#M281601</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the loadscript, I have the below variable definition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14274444585922902" jivemacro_uid="_14274444585922902"&gt;
&lt;P&gt;Set f_CreateSheetVisibilityVariable = 'v_' &amp;amp; $1 &amp;amp; PURGECHAR($(=$1 &amp;amp; 'FrontMenu' &amp;amp; $2), ' -+*/^(){}%&amp;amp;#"') &amp;amp; 'Visible';&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I check the definition of CreateSheetVisibilityVariable in the variable overview, I can only see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14274444649871147" jivemacro_uid="_14274444649871147"&gt;
&lt;P&gt;'v_' &amp;amp; $1 &amp;amp; PURGECHAR(, ' -+*/^(){}%&amp;amp;#"') &amp;amp; 'Visible'&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The $(=$1 &amp;amp; 'FrontMenu' &amp;amp; $2) seems to have disappeared. Can someone please tell me how to set the variable in the load script so that this part does not get evaluated/disappear during the loadscript reload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shah&lt;/P&gt;&lt;DIV style="left: 688px; top: 97px;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Mar 2015 08:21:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-27T08:21:09Z</dc:date>
    <item>
      <title>Load script: Define variable and assign an expression with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797128#M281595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the load script, I want to define a variable and assign an expression to it. However, I am getting an error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14273668258724674" jivemacro_uid="_14273668258724674" modifiedtitle="true"&gt;
&lt;P&gt;Let&amp;nbsp; ClassificationDimensionName&amp;nbsp; = only({&amp;lt;%ClassificationDimensionId = {$1} &amp;gt;} %ClassificationDimension) ;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please tell me how to define such expressions in load script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 10:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797128#M281595</guid>
      <dc:creator />
      <dc:date>2015-03-26T10:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Load script: Define variable and assign an expression with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797129#M281596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm afraid you can't use set analysis in the load script. However you should be able to create a variable in the Variable Overview (Ctrl+Alt+V) that uses set analysis to define your ClassificationDimensionName. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that doesn't work it might help if you can post a qvw file example for us to refer to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 10:55:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797129#M281596</guid>
      <dc:creator>nickking</dc:creator>
      <dc:date>2015-03-26T10:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Load script: Define variable and assign an expression with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797130#M281597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LET will try to evaluate everything right from the equal sign. No set analysis in scripts, sorry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use SET statement instead LET.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 10:55:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797130#M281597</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-26T10:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Load script: Define variable and assign an expression with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797131#M281598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well actually these variables are defined in the variable overview. However, I am using a source control and need to define and declare all the variables in the load script so that If someone gets the version from source control, they don't lose the variables definitions and values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other way I can achieve this? The only option I can think of is to declare them all in the load script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 11:02:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797131#M281598</guid>
      <dc:creator />
      <dc:date>2015-03-26T11:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Load script: Define variable and assign an expression with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797132#M281599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using VC, there is no other option as QV won't store the actual variable values in an xml when saving to your version control system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To regain some flexibility, you could store the variable values in an external source file, or store them in an Excel file. The first solution offers one more trick: you'll need the external source file only after every extract from VCS. All subsequent reloads will never complain about a missing source file (that's what $(Include) is good at)&amp;nbsp; and will keep the variables untouched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 11:50:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797132#M281599</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-26T11:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Load script: Define variable and assign an expression with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797133#M281600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shah, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Script:&lt;/P&gt;&lt;P&gt;set vVariable = count({$&amp;lt;[Tier]={$1,$2}, [Stream]={$3,$4}, [Flag]={1}&amp;gt;} DISTINCT [ID]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call of Variable:&lt;/P&gt;&lt;P&gt;$(vVariable('I','II','SI','SII'))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 11:55:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797133#M281600</guid>
      <dc:creator>karolina_</dc:creator>
      <dc:date>2015-03-26T11:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Load script: Define variable and assign an expression with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797134#M281601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the loadscript, I have the below variable definition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14274444585922902" jivemacro_uid="_14274444585922902"&gt;
&lt;P&gt;Set f_CreateSheetVisibilityVariable = 'v_' &amp;amp; $1 &amp;amp; PURGECHAR($(=$1 &amp;amp; 'FrontMenu' &amp;amp; $2), ' -+*/^(){}%&amp;amp;#"') &amp;amp; 'Visible';&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I check the definition of CreateSheetVisibilityVariable in the variable overview, I can only see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14274444649871147" jivemacro_uid="_14274444649871147"&gt;
&lt;P&gt;'v_' &amp;amp; $1 &amp;amp; PURGECHAR(, ' -+*/^(){}%&amp;amp;#"') &amp;amp; 'Visible'&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The $(=$1 &amp;amp; 'FrontMenu' &amp;amp; $2) seems to have disappeared. Can someone please tell me how to set the variable in the load script so that this part does not get evaluated/disappear during the loadscript reload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shah&lt;/P&gt;&lt;DIV style="left: 688px; top: 97px;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 08:21:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797134#M281601</guid>
      <dc:creator />
      <dc:date>2015-03-27T08:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Load script: Define variable and assign an expression with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797135#M281602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's because $-substitution is executed just before the SET statement is parsed. The parameters however stay put.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A possible solution could be to use another character for delayed $-sign substitutions, and replace this in a subsequent LET statement. The script engine won't notice because at the time the engine parses statements, there isn't anything visible that looks like $(...). For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Set f_CreateSheetVisibilityVariable = 'v_' &amp;amp; $1 &amp;amp; PURGECHAR(#(=$1 &amp;amp; 'FrontMenu' &amp;amp; $2), ' -+*/^(){}%&amp;amp;#"') &amp;amp; 'Visible';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Let f_Create&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;SheetVisibilityVariable = replace(f_Create&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;SheetVisibilityVariable, '#', '$');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 08:34:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-script-Define-variable-and-assign-an-expression-with-set/m-p/797135#M281602</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-27T08:34:18Z</dc:date>
    </item>
  </channel>
</rss>

