<?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: varuavle and set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233384#M392730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;if you want to calculate the value in the script &lt;/P&gt;&lt;P&gt;then you'll need to run a query on the loaded table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like : &lt;/P&gt;&lt;P&gt;Sum:&lt;/P&gt;&lt;P&gt;load sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;COMPONENTVALUE&lt;/SPAN&gt;) AS Sum_&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;COMPONENTVALUE&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: 13px;"&gt;resident Data&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: 13px;"&gt;where &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10.6667px;"&gt;COMPONENETID = 49 and&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;YearMonth&lt;/SPAN&gt; &amp;gt; addyears(max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;YearMonth&lt;/SPAN&gt;),-1)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then you can assign the result to a variable &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vSum = peek('&lt;SPAN style="font-size: 13.3333px;"&gt;Sum_&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;COMPONENTVALUE&lt;/SPAN&gt;',0,'Sum');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Mar 2017 08:25:03 GMT</pubDate>
    <dc:creator>lironbaram</dc:creator>
    <dc:date>2017-03-06T08:25:03Z</dc:date>
    <item>
      <title>varuavle and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233383#M392729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;in my script i calaulate a variable that have -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM((Sum({&amp;lt;YearMonth={"&amp;gt;$(v_from_date)"},COMPONENETID={"49"}&amp;gt;}COMPONENTVALUE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and my variable v_from_date=&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AddYears&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MakeDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),1),-1),'YYYYMM') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;it not working!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;i need the sum of component value when YearMonth&amp;gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AddYears&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MakeDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),1),-1),'YYYYMM')&amp;nbsp; andCOMPONENETID={"49"}&amp;gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;how can i get it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;adi&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 07:01:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233383#M392729</guid>
      <dc:creator>adiarnon</dc:creator>
      <dc:date>2017-03-06T07:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: varuavle and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233384#M392730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;if you want to calculate the value in the script &lt;/P&gt;&lt;P&gt;then you'll need to run a query on the loaded table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like : &lt;/P&gt;&lt;P&gt;Sum:&lt;/P&gt;&lt;P&gt;load sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;COMPONENTVALUE&lt;/SPAN&gt;) AS Sum_&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;COMPONENTVALUE&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: 13px;"&gt;resident Data&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: 13px;"&gt;where &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10.6667px;"&gt;COMPONENETID = 49 and&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;YearMonth&lt;/SPAN&gt; &amp;gt; addyears(max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;YearMonth&lt;/SPAN&gt;),-1)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then you can assign the result to a variable &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vSum = peek('&lt;SPAN style="font-size: 13.3333px;"&gt;Sum_&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;COMPONENTVALUE&lt;/SPAN&gt;',0,'Sum');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 08:25:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233384#M392730</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2017-03-06T08:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: varuavle and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233385#M392731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its &lt;SPAN lang="en"&gt;not what I meant&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;i need that the expression will &lt;SPAN lang="en"&gt;Calculated&lt;/SPAN&gt; on the fly and not in the script&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;in the script i &lt;SPAN class="tw-bilingual-translation" dir="ltr" lang="en"&gt;define&lt;/SPAN&gt; the expression of the variable-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;YearMonth={"&amp;gt;$(v_from_date)"},COMPONENETID={"49"}&amp;gt;}COMPONENTVALUE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the v_from_date is depend on the selection of the user&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 08:33:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233385#M392731</guid>
      <dc:creator>adiarnon</dc:creator>
      <dc:date>2017-03-06T08:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: varuavle and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233386#M392732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;try using those variables &lt;/P&gt;&lt;P&gt;let vSum= 'NUM(Sum({&amp;lt;YearMonth={"&amp;gt;$' &amp;amp; '(v_from_date) &amp;lt;=$' &amp;amp; '(=max(YearMonth))"},COMPONENETID={"49"}&amp;gt;}COMPONENTVALUE))';&lt;/P&gt;&lt;P&gt;set&amp;nbsp; v_from_date=&amp;nbsp; '=date(AddYears(max(YearMonth),-1))';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i added a restriction that it will calculate 12 months period to max selected date &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 08:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233386#M392732</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2017-03-06T08:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: varuavle and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233387#M392733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tnx its help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i still have a problem&lt;/P&gt;&lt;P&gt;if im just writing an expression-&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;$(=date(AddYears(MakeDate(max(Year),max(Month),1),-1),'YYYYMM'))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;COMPONENETID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"49"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;COMPONENTVALUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;i get the right numbet&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;i have a variable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;the have -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Sum({&amp;lt;YearMonth={"&amp;gt;$=date(AddYears(MakeDate(max(Year),max(Month),1),-1),'YYYYMM')"},COMPONENETID={"49"}&amp;gt;}COMPONENTVALUE)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;the different is ( )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;but when im try to insert the () the variable get &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Sum({&amp;lt;YearMonth={"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;whats the problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 09:37:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233387#M392733</guid>
      <dc:creator>adiarnon</dc:creator>
      <dc:date>2017-03-06T09:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: varuavle and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233388#M392734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;You Can&amp;nbsp; try out this expression :&lt;/P&gt;&lt;P&gt;Sum({&amp;lt; COMPONENT_ID={"49"}, YearMonth={"&amp;gt;= $(=date(AddYears(MakeDate(max(YEAR),max(MONTH),1),-1))&amp;nbsp; "}&amp;gt;}COMPONENT_VALUE) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 10:08:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233388#M392734</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-06T10:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: varuavle and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233389#M392735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the problem &lt;/P&gt;&lt;P&gt;is that Qlik sees the $ signs and try to calculate the part after the $ sign as a variable &lt;/P&gt;&lt;P&gt;change your variable expression in the script to &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10.6667px; background-color: #f2f2f2;"&gt;let vExpression ='Sum({&amp;lt;YearMonth={"&amp;gt;$' &amp;amp; '=date(AddYears(MakeDate(max(Year),max(Month),1),-1),'YYYYMM')"},COMPONENETID={"49"}&amp;gt;}COMPONENTVALUE)';&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: 10.6667px; 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: 10.6667px; background-color: #f2f2f2;"&gt;this will build the right expression inside the variable &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 11:15:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233389#M392735</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2017-03-06T11:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: varuavle and set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233390#M392736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;Let x='Sum({&amp;lt;YearMonth={"&amp;gt;$(=date(AddYears(MakeDate(max(Year),max(Month),1),-1),'YYYYMM'))"},COMPONENETID={49}&amp;gt;}COMPONENTVALUE)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;Sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 12:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/varuavle-and-set-analysis/m-p/1233390#M392736</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2017-03-06T12:34:23Z</dc:date>
    </item>
  </channel>
</rss>

