<?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: Variables and nested set analysis ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043915#M351108</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Continuing the line that Sunny started, - you can use your conditional formula stored in a variable, as part of the Advanced Search filter that can be applied to a field. Assuming that your condition needs to be applied to the field User, the filter could look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="func" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #ff1493;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;({$&amp;lt; User = {"=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue;"&gt;$(vL.tmp)&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt; &amp;lt;&amp;gt;0"} &amp;gt;} Users ) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;Notice the double quotes (search), the equal sign (advanced search) and the variable doesn't need to be enclosed in single quotes in this case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Upgrade your Qlik skills at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Milan, Italy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Feb 2016 17:35:50 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2016-02-16T17:35:50Z</dc:date>
    <item>
      <title>Variables and nested set analysis ?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043911#M351104</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;I have created a variable that holds a set analys in it:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vL.tmp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14556351803372588 jive_text_macro" jivemacro_uid="_14556351803372588"&gt;
&lt;P&gt;(IF([Test] = 'Hello', SUM({$&amp;lt;[Flag1] = {1} &amp;gt;} Time) - SUM({$&amp;lt;[Flag2] = {1} &amp;gt;} Time), SUM({$&amp;lt;[Flag3] = {1} &amp;gt;} Time)))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i'm trying to nested this variable with another set analyse but i do not get my wanted result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14556351759134079" jivemacro_uid="_14556351759134079"&gt;
&lt;P&gt;COUNT({$&amp;lt; '$(&lt;STRONG style="font-size: 13.3333330154419px;"&gt;vL.tmp&lt;/STRONG&gt;)' -={0} &amp;gt;} Users )&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to exclude users if the &lt;STRONG&gt;vL.tmp&lt;/STRONG&gt; = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can it be that my first &lt;SPAN style="font-size: 13.3333330154419px;"&gt;variable don´t have a aggregation around it?, &lt;EM&gt;i do get a result from &lt;STRONG style="font-size: 13.3333330154419px;"&gt;vL.tmp &lt;/STRONG&gt;if i use a textbox&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 15:08:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043911#M351104</guid>
      <dc:creator>Sahal</dc:creator>
      <dc:date>2016-02-16T15:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Variables and nested set analysis ?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043912#M351105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK the left side of the set modifier cannot have functions. Can you share a sample of what you doing and may be we can help you better?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 16:45:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043912#M351105</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-16T16:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Variables and nested set analysis ?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043913#M351106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Sunny said&amp;nbsp; the left of the set modifier cannot have functions, only fields. What you can use is an expression search in set analysis, for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;=Count( {&amp;lt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Users= {"=Sum(Value) &amp;gt; 0"}&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt; &amp;gt;}&amp;nbsp; Users)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Note the double quotes, any expression that is evaluated to true can be used on the right side. In your case you will have to make the right side variable to account for the different situations, or use different expressions within some if statements.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 16:51:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043913#M351106</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2016-02-16T16:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Variables and nested set analysis ?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043914#M351107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;may be you can try like if($(vL.tmp)&amp;lt;&amp;gt;0, Count(Users))&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 17:34:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043914#M351107</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2016-02-16T17:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Variables and nested set analysis ?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043915#M351108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Continuing the line that Sunny started, - you can use your conditional formula stored in a variable, as part of the Advanced Search filter that can be applied to a field. Assuming that your condition needs to be applied to the field User, the filter could look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="func" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #ff1493;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;({$&amp;lt; User = {"=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue;"&gt;$(vL.tmp)&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt; &amp;lt;&amp;gt;0"} &amp;gt;} Users ) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;Notice the double quotes (search), the equal sign (advanced search) and the variable doesn't need to be enclosed in single quotes in this case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Upgrade your Qlik skills at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Milan, Italy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 17:35:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043915#M351108</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2016-02-16T17:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Variables and nested set analysis ?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043916#M351109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Piet Hein and Sunny already answered your question, so I'll try to explain what was wrong with your initial assumption: in your last set expression, the lefthand side of the modifier (if it would work, but it doesn't) is a single result of an aggregation function and not something that can be regarded as a set or a set container (like a field can be). You are using the compact set operator -= to subtract a set containing a single value {0} from ... what?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually a set modifier has a very simple design:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Field = {Series of new field values to be assigned to the field but only temporarily while the aggregation lasts}&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and your use of the compact operator in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Field -= {Series of values to be excluded from what is currently present in Field...}&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is actually identical to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Field = Field - {Series of values to be excluded from what is currently present in Field...}&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All three elements in this set expression should&lt;SPAN style="font-size: 13.3333px;"&gt; somehow&lt;/SPAN&gt; represent a set of zero or more values. And a set is just a collection of values, even when coded as an advanced search expression. However, the equal sign is an assignment operator, not a comparison operator. And you can only assign values or expression results to an object &lt;EM&gt;that can be modified&lt;/EM&gt;. A field is such an object. A fixed numercial value that results from an aggregation expression is not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 17:36:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043916#M351109</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-02-16T17:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variables and nested set analysis ?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043917#M351110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im still having problems here and i will try to explain more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my first picture i have the &lt;STRONG&gt;Nr&lt;/STRONG&gt; and the &lt;STRONG&gt;User as dimensions &lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;2 expressions &lt;STRONG&gt;vL.tmp &lt;/STRONG&gt;and the value in the variable it self as the second expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/114965_Capture.PNG" style="width: 620px; height: 139px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not understand why im getting 2 different values from my variable and the "value in the variable"&lt;/P&gt;&lt;P&gt;This can be one of the problems i'm facing and that is why i'm not getting my desired result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second picture i used the variable &lt;STRONG&gt;vL.tmp &lt;/STRONG&gt;for my set analysis but this did not work.&lt;/P&gt;&lt;P&gt;with &lt;SPAN class="func" style="color: #ff1493; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;({$&amp;lt; User = {"=&lt;/SPAN&gt;&lt;SPAN class="string" style="color: blue; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;$(vL.tmp)&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt; &amp;lt;&amp;gt;0"} &amp;gt;} Users )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/114966_Capture.PNG" style="width: 620px; height: 209px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like you see in my list i do not get anything ?&lt;/P&gt;&lt;P&gt;Is the syntax wrong or can it be something else? .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to exlude &lt;STRONG&gt;1057 - Rafael Martinez&lt;/STRONG&gt; Velez from my count of users beause he have 0 time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;having this said i do understand why im can not in this case exlude &lt;STRONG&gt;1057 &lt;/STRONG&gt;because his time is 706,86 but i do not understand what my &lt;STRONG&gt;vL.tmp&lt;/STRONG&gt; is doing wrong?, and what the set analys is doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:19:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043917#M351110</guid>
      <dc:creator>Sahal</dc:creator>
      <dc:date>2016-02-17T13:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Variables and nested set analysis ?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043918#M351111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be a lot easier to troubleshoot if you could post your application or a small sample...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the pictures, the formula in your variable vL.tmp begins with the equal sign, and it's being evaluated only once, outside of the chart - it means, that it's NOT being evaluated in every row of the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to make this variable "Dimensional", i.e. allow it to be evaluated in every row of the chart, you should remove the equal sign from the variable AND enclose the variable into the $-sign expression in chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vL.tmp)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, as a side comment, - if you leave the Expression Label empty, you will see the formula fully expanded,- your variables will get expanded, and you will see the final expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone who is confused about the various uses of variables, should listen to Rob Wunderlich's lecture on Advanced Scripting at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt;. Rob doesn't leave any room for confusion anymore...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 16:46:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-and-nested-set-analysis/m-p/1043918#M351111</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2016-02-17T16:46:29Z</dc:date>
    </item>
  </channel>
</rss>

