<?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: Looking for correct syntax to use variable in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510452#M1146856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much, it worked! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Aug 2013 07:20:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-08-21T07:20:44Z</dc:date>
    <item>
      <title>Looking for correct syntax to use variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510447#M1146851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some help finding correct syntax to use variable in set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When my expression is written as following, it works fine and returns correct value. Please note that week name "2013/33" is entered in manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;=Num(Avg({$&amp;lt;[Year Week]={'2013/33'}&amp;gt;}Cost]),'#,##0.00')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assigned variable to variable to find out present week's weekname and name is as "vPresentWeekName".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;vPresentWeekName = Weekname(Today())&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;I now would like to replace "2013/33" to this new variable "vPresentWeekName" but I could not figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following is what I tried but it does not work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Avg({&amp;lt;[Year Week]={$(=vPresentWeekname)}&amp;gt;} Cost)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you have any suggestions or recommendations for me? Will be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best wishes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p1907&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 06:47:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510447#M1146851</guid>
      <dc:creator />
      <dc:date>2013-08-21T06:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for correct syntax to use variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510448#M1146852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Avg({[Year Week]={'$(=vPresentWeekname)'}&amp;gt;} Cost)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add ' symbol ... but are you sure that Weekname(Today()) returns the value formatted as you need?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 06:51:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510448#M1146852</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-08-21T06:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Looking for correct syntax to use variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510449#M1146853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class="replyToName"&gt;Alessandro,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;Thanks for your swift support and help; really appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;Noted on your expression suggestion but it still returns nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;&lt;/SPAN&gt;My variable &lt;EM&gt;&lt;STRONG style="color: #808080;"&gt;vPresentWeekName&lt;/STRONG&gt;&lt;/EM&gt; = Weekname(Today()) returns 2013/34 for today; which is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I cannot figure out is that when I enter in the week name manually into the expression, it is working fine. Took your advice to see if variable is returning the value as intended formatting and it seems to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where else shall I check or what am I missing, any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, I added "&lt;STRONG style="color: #ff0000;"&gt;&amp;lt;&lt;/STRONG&gt;" to the expression: Avg({&lt;SPAN style="color: #ff0000;"&gt;&amp;lt;&lt;/SPAN&gt;[Year Week]={$(=vPresentWeekname)}&amp;gt;} Cost)&lt;/P&gt;&lt;P&gt;&lt;STRONG class="font-color-meta"&gt;&lt;SPAN class="replyToName"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;Best wishes,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="font-color-meta"&gt;&lt;SPAN class="replyToName"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;p1907&lt;/SPAN&gt;&lt;STRONG class="font-color-meta"&gt;&lt;SPAN class="replyToName"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="font-color-meta"&gt;&lt;SPAN class="replyToName"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="font-color-meta"&gt;&lt;SPAN class="replyToName"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 07:02:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510449#M1146853</guid>
      <dc:creator />
      <dc:date>2013-08-21T07:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for correct syntax to use variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510450#M1146854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;try with below syntax&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=Avg({&lt;SPAN style="color: #ff0000;"&gt;&amp;lt;&lt;/SPAN&gt;[Year Week]={"$(=$(vPresentWeekname))"}&amp;gt;} Cost)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 07:17:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510450#M1146854</guid>
      <dc:creator />
      <dc:date>2013-08-21T07:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for correct syntax to use variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510451#M1146855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Define in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET &lt;EM&gt;&lt;STRONG style="color: #808080;"&gt;vPresentWeekName&lt;/STRONG&gt;&lt;/EM&gt; = Weekname(Today())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you set analyis expression will be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Num(Avg({$ &amp;lt;[Year Week]={$&lt;EM&gt;&lt;STRONG style="color: #808080;"&gt;vPresentWeekName&lt;/STRONG&gt;&lt;/EM&gt;}&amp;gt;}Cost]),'#,##0.00')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 07:17:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510451#M1146855</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-08-21T07:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for correct syntax to use variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510452#M1146856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much, it worked! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 07:20:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-correct-syntax-to-use-variable-in-set-analysis/m-p/510452#M1146856</guid>
      <dc:creator />
      <dc:date>2013-08-21T07:20:44Z</dc:date>
    </item>
  </channel>
</rss>

