<?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: Set analysis with variable in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124284#M633273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to be working for the sample I created. Check it out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({$(=vSelect)}DailyProduction)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({$(vSelect)}DailyProduction)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jun 2016 15:17:30 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-06-03T15:17:30Z</dc:date>
    <item>
      <title>Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124279#M633268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For analysis I need a result depending expression. &lt;BR /&gt;The expressions has to be:&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3366ff;"&gt; =avg({$} DISTINCT DailyProduction)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;or: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3366ff;"&gt;=avg({1} DISTINCT DailyProduction)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a variable vSelect I move the character 1 or $.&lt;/P&gt;&lt;P&gt;I thought that I could use the following expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3366ff;"&gt;=avg({=$(vSelect)} DISTINCT DailyProduction)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;but unfortunately this expression results always in an error.&lt;/P&gt;&lt;P&gt;Does anyone know a solution for this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 13:48:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124279#M633268</guid>
      <dc:creator>rennesia</dc:creator>
      <dc:date>2016-06-03T13:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124280#M633269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Avg({&lt;SPAN style="color: #ff0000;"&gt;$(=vSelect)&lt;/SPAN&gt;} DISTINCT DailyProduction)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Avg({&lt;SPAN style="color: #ff0000;"&gt;$(=$(vSelect))&lt;/SPAN&gt;} DISTINCT DailyProduction)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 13:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124280#M633269</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-03T13:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124281#M633270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thanks Sunny, but both solutions give the 'feared' red line under the text &lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;DISTINCT DailyProduction).&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;BR /&gt;&lt;/SPAN&gt;When I show the results in a text object, the returning text is: &lt;STRONG&gt;Error in expression: '}' expected.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;That is also the returning text from my own solution...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 14:05:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124281#M633270</guid>
      <dc:creator>rennesia</dc:creator>
      <dc:date>2016-06-03T14:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124282#M633271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or maybe just&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Avg( {$(vSelect)} DISTINCT DailyProduction)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It depends on how you set your variable.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3444"&gt;The Magic of Dollar Expansions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3406"&gt;The Magic of Variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3996"&gt;The Little Equals Sign&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 14:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124282#M633271</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-03T14:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124283#M633272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks also Swuehl, but this solution has the same error in result.&lt;/P&gt;&lt;P&gt;Nice documents! I'll read them next days (weekend) and try next week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 14:28:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124283#M633272</guid>
      <dc:creator>rennesia</dc:creator>
      <dc:date>2016-06-03T14:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124284#M633273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to be working for the sample I created. Check it out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({$(=vSelect)}DailyProduction)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({$(vSelect)}DailyProduction)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 15:17:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124284#M633273</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-03T15:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124285#M633274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;test this possibility&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(vSelect = 1, Avg({ 1 } DISTINCT DailyProduction) , Avg({ $ } DISTINCT DailyProduction))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 16:50:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124285#M633274</guid>
      <dc:creator />
      <dc:date>2016-06-03T16:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124286#M633275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, the syntax checker is not really reliable when it comes to e.g. dollar sign variable expansions (similar issues also for examples with implicite set operators).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2016-06-04 01_40_23-Edit Expression.png" class="jive-image image-1" src="/legacyfs/online/126864_2016-06-04 01_40_23-Edit Expression.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just click OK and check if it's working. I would assume it does work, if your variable is set just to 1 or $ as shown in Sunny's sample.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 23:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124286#M633275</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-03T23:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124287#M633276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, it doesn't work... &lt;BR /&gt;I read the document 'The magic of dollar expansions' and have to conclude (in combination with my tests) that a $ as textual variable is not the same as a direct $ in the function. (Quote: 'A dollar expansion is something that is done &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;before&lt;/EM&gt;&lt;/SPAN&gt; the expression (or statement) is evaluated.')&lt;BR /&gt;The only way to get my result is write out the complete syntax as Claiton Luiz suggested.&lt;BR /&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2016 07:04:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124287#M633276</guid>
      <dc:creator>rennesia</dc:creator>
      <dc:date>2016-06-06T07:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124288#M633277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this answer. It think that this is the only solution for the moment. Read also my reply to Swuehl below...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2016 07:07:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124288#M633277</guid>
      <dc:creator>rennesia</dc:creator>
      <dc:date>2016-06-06T07:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124289#M633278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Strange.&lt;/P&gt;&lt;P&gt;Isn't Sunny's sample QVW working for you just fine and demonstrating that the dollar sign expansion is working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using what I've suggested above:&lt;/P&gt;&lt;P&gt;=Count({$(vSelect)}DailyProduction)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and a simple input box that changes the variable between the two literals:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2016-06-06 12_37_00-QlikView x64 - [C__Users_Stefan_Downloads_Community_219486 (1).qvw_].png" class="jive-image image-1" src="/legacyfs/online/126929_2016-06-06 12_37_00-QlikView x64 - [C__Users_Stefan_Downloads_Community_219486 (1).qvw_].png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2016-06-06 12_37_12-QlikView x64 - [C__Users_Stefan_Downloads_Community_219486 (1).qvw_].png" class="jive-image image-2" src="/legacyfs/online/126930_2016-06-06 12_37_12-QlikView x64 - [C__Users_Stefan_Downloads_Community_219486 (1).qvw_].png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still assume it's all about how you combine the dollar sign expansion with your variable definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems like you don't want to share how you exactely do this, so I won't insist on offering more help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2016 10:42:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124289#M633278</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-06T10:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124290#M633279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan,&lt;/P&gt;&lt;P&gt;Indeed, the entire document may not be distributed ... So I made yesterday a small test document to post at the community. But, the problem was not reproducible! Everything worked fine. &lt;BR /&gt; Conclusion: I will erase a part of the original document and start again.&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 11:39:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124290#M633279</guid>
      <dc:creator>rennesia</dc:creator>
      <dc:date>2016-06-07T11:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124291#M633280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for help Sunny. I tried several times with bad results, but when I decide to make a new document, everything works fine. (See also my last reaction to Swuehl at Jun 7.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 11:43:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-variable-in-expression/m-p/1124291#M633280</guid>
      <dc:creator>rennesia</dc:creator>
      <dc:date>2016-06-07T11:43:52Z</dc:date>
    </item>
  </channel>
</rss>

