<?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: Nesting variables in script for set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143040#M629117</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not&amp;nbsp; sure if I have understood you correctly ? If you say you have to exclude ETAPA for some cases so why cant you put that case outside the SET like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If case1 , sum({&amp;lt;ETAPA-={0,1,200}&amp;gt; } amount)&amp;nbsp; else sum(amount)&lt;/STRONG&gt;&amp;nbsp; and do you really need to create 2 variables as you can edit the filters in the ETAPA even if you use 1 variable &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jul 2016 03:53:45 GMT</pubDate>
    <dc:creator>qliksus</dc:creator>
    <dc:date>2016-07-26T03:53:45Z</dc:date>
    <item>
      <title>Nesting variables in script for set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143038#M629115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;I have a variable in my script that is&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14694829216608541 jive_text_macro" jivemacro_uid="_14694829216608541"&gt;
&lt;P&gt;Set var_IAP= =Sum({&amp;lt;Tipo_ap={Produção}, ETAPA-={50,21,100}&amp;gt;} QUANTIDADE)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;'Etapa' exclusion is very common and I need to change it frequently (include another number like 200), so I created a new variable:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14694830150375824 jive_text_macro" jivemacro_uid="_14694830150375824"&gt;
&lt;P&gt;Set var_etapa_excluir= , ETAPA-={50,21,100};&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;And now I am trying to nest both using:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14694830422988278 jive_text_macro" jivemacro_uid="_14694830422988278" modifiedtitle="true"&gt;
&lt;P&gt;=Sum({&amp;lt;Tipo_ap={Produção} var_etapa_excluir &amp;gt;} QUANTIDADE)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Note that in many cases I need to exclude 'Etapa', but not in all cases. So my concern is to use as a variable, to avoid editing all the script that has more than 20 other variables.&lt;/P&gt;&lt;P&gt;In chart I just use var_IAP.&lt;/P&gt;&lt;P&gt;What is the correct way to nest variables in script? What am I doing wrong?&lt;/P&gt;&lt;P&gt;Thanks and best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 21:47:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143038#M629115</guid>
      <dc:creator>h_demarco</dc:creator>
      <dc:date>2016-07-25T21:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting variables in script for set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143039#M629116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might have to play around with this to get this to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/1062225"&gt;Re: Expression as a variable with $-sign expansion&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/7455"&gt;Stop Dollar Sign Expansion in the script (Escape Character ??? )&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 22:08:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143039#M629116</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-07-25T22:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting variables in script for set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143040#M629117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not&amp;nbsp; sure if I have understood you correctly ? If you say you have to exclude ETAPA for some cases so why cant you put that case outside the SET like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If case1 , sum({&amp;lt;ETAPA-={0,1,200}&amp;gt; } amount)&amp;nbsp; else sum(amount)&lt;/STRONG&gt;&amp;nbsp; and do you really need to create 2 variables as you can edit the filters in the ETAPA even if you use 1 variable &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 03:53:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143040#M629117</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2016-07-26T03:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting variables in script for set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143041#M629118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set var_etapa_excluir= , ETAPA-={50,21,100};&amp;nbsp; &lt;/P&gt;&lt;P&gt;Set var_IAP = =Sum({&amp;lt;Tipo_ap={Produção} #(var_etapa_excluir) &amp;gt;} QUANTIDADE);&lt;/P&gt;&lt;P&gt;Let var_IAP = Replace(var_IAP, '#', '$');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for two steps for var_IAP is to defer the $ expansion of var_etapa_excluir until the expression is evaluated in the front end. "Set" will expand the variable so it will no longer be dynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We substitute # for $ to prevent the expansion and put it back with the replace step. The replace does not trigger the expansion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may get syntax warnings because the syntax check does not know what you intend to do with the variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 05:13:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143041#M629118</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2016-07-26T05:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting variables in script for set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143042#M629119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think my explanion was not clear, but below explanation may help:&lt;/P&gt;&lt;P&gt;I have 100 variables and 80 of them contain &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&amp;lt;ETAPA-={0,1,200}&amp;gt;&lt;/STRONG&gt;. If I want to include one ETAPA number into array like &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&amp;lt;ETAPA-={0,1,200,205}&amp;gt;&lt;/STRONG&gt;, will I need to change 80 lines of code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 19:57:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143042#M629119</guid>
      <dc:creator>h_demarco</dc:creator>
      <dc:date>2016-07-27T19:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Nesting variables in script for set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143043#M629120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeahh... it worked!&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 20:01:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nesting-variables-in-script-for-set-analysis/m-p/1143043#M629120</guid>
      <dc:creator>h_demarco</dc:creator>
      <dc:date>2016-07-27T20:01:33Z</dc:date>
    </item>
  </channel>
</rss>

