<?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 question/problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452741#M565730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works. By removing the " in the formula it worked. Thanks for the answer!!! It realy helped me out here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetz,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Dec 2012 16:20:49 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-19T16:20:49Z</dc:date>
    <item>
      <title>Set analysis question/problem</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452738#M565727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Set Analysis question/problem that I'm trying to solve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my chart I have the following calculation : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SUM({&amp;lt;DateWeek={$(=MAX(Week(QuestionaireDate))-1)} Aantal)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine in my chart where it shows me the total number for the previous week based on the selected week. I would like to make this a variable so in my script I have put the following statement after the SET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SUM({&amp;lt;DateWeek={$(=MAX(Week(QuestionaireDate))-1)} &amp;gt;} Aantal)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I select the variable in de Expression Editor it gives me the following formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SUM({&amp;lt;DateWeek={}&amp;gt;} Aantal)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the formula gets lost so probably calculation is wrong. My question is how to get this in the script in a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried several things like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SUM({&amp;lt;DateWeek={ ' $(=MAX(Week(QuestionaireDate))-1) ' } &amp;gt;} Aantal) &lt;/EM&gt;But this gives me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;SUM({&amp;lt;DateWeek={''}&amp;gt;} Aantal)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And even tried this one&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SUM({&amp;lt;DateWeek={ " $(=MAX(Week(QuestionaireDate))-1) " } &amp;gt;} Aantal) &lt;/EM&gt;But this gives me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;SUM({&amp;lt;DateWeek={""}&amp;gt;} Aantal)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last thing I tried was this one&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a variable called vPreviousWeek with expression &lt;EM&gt;SET vPreviousWeek = $(MAX(Week(&lt;EM&gt;QuestionaireDate&lt;/EM&gt;))-1)&lt;/EM&gt; and then the expression for another variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;EM&gt;SUM({&amp;lt;DateWeek={$(vPreviousWeek)} &amp;gt;} Aantal) &lt;/EM&gt;But this gives me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SUM({&amp;lt;DateWeek={} Aantal)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please help me out? I love the possibilities of Set Analysis but it would be nice if it is possible to use the above one. Simply set I want to put my Set Analysis expression in a variable where in the expression a Max week is calculated based upon the selected week in de QV application. Should not be so difficult I thought but it seems rather extremely difficult to get it working outside of a chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 15:29:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452738#M565727</guid>
      <dc:creator />
      <dc:date>2012-12-19T15:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis question/problem</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452739#M565728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's happening is that when setting the variable qlikview tries to evaluate the part of your expression that starts with $. Since that returns nothing you get the result you see. You can try it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LET variable = '&lt;/SPAN&gt;&lt;EM&gt;SUM({&amp;lt;DateWeek={" &lt;/EM&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;' &amp;amp; '$' &amp;amp; '&lt;/SPAN&gt;&lt;EM&gt;(=MAX(Week(QuestionaireDate))-1) " } &amp;gt;} Aantal)&lt;/EM&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;';&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 15:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452739#M565728</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-19T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis question/problem</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452740#M565729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the reply. Unfortunately it still does'nt work. It gives me now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;DateWeek={"$(=MAX(Week(EnqueteDatum))-1) " } &amp;gt;} Aantal) als value in my chart for every row and it is not calculating the answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oeps, forgot the change SET to LET...I'm almost there. It now gives&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;DateWeek={"49" } &amp;gt;} Aantal) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetz,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 16:09:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452740#M565729</guid>
      <dc:creator />
      <dc:date>2012-12-19T16:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis question/problem</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452741#M565730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works. By removing the " in the formula it worked. Thanks for the answer!!! It realy helped me out here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetz,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 16:20:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question-problem/m-p/452741#M565730</guid>
      <dc:creator />
      <dc:date>2012-12-19T16:20:49Z</dc:date>
    </item>
  </channel>
</rss>

