<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409425#M152242</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;You have to create a variable : &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;vPeendtnum=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}peendtnum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Then your formula will be: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=sum(&lt;SPAN style="font-size: 8pt;"&gt;{&amp;lt;peendtnum&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=(&lt;SPAN style="font-size: 8pt;"&gt;vPeendtnum&lt;/SPAN&gt;))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;/SPAN&gt;hrsbudmth)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Mar 2013 15:14:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-03-05T15:14:49Z</dc:date>
    <item>
      <title>Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409422#M152239</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 am new to qlikview and I am having difficulty in creating an expression in giving me the sum of "hrsbudmth" for the latest period only regardless if another period is selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My period has a date attached which is in dd/mm/yyyy format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At present my expression is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;peendtnum = {$(=max(peendtnum))}&amp;gt;} hrsbudmth)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am converting the date to a number in my load statement hence the name peendtnum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have looked at other set analysis blogs but cannot work out why my expression is changing if I select another period?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 14:21:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409422#M152239</guid>
      <dc:creator />
      <dc:date>2013-03-05T14:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409423#M152240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There may be other fields influencing the possible max value. To make the expression ignore all other expressions use: &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=sum({1&amp;lt;peendtnum = {$(=max({1}peendtnum))}&amp;gt;} hrsbudmth)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;If you want to ignore selections in specific fields use something like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=sum({&amp;lt;MyField1=, MyField2=, peendtnum = {$(=max({1}peendtnum))}&amp;gt;} hrsbudmth)&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 14:26:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409423#M152240</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-03-05T14:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409424#M152241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply Gysbert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value 0213 = 100.00&lt;/P&gt;&lt;P&gt;value 0113 = 50.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried your formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({1&amp;lt;peendtnum = {$(=max(peendtnum))}&amp;gt;} hrsbudmth)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I do not select a period from my period list box the value in my box (Current Month) shows the amount (100.00) for the lastest period (0213), however when I select period 0113 the amount changes to the value relating to 0113 (50.00) when I want this to stay as 100.00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I have another box called (Previous month) which is where the 50.00 should appear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 14:35:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409424#M152241</guid>
      <dc:creator />
      <dc:date>2013-03-05T14:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409425#M152242</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;You have to create a variable : &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;vPeendtnum=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}peendtnum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Then your formula will be: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=sum(&lt;SPAN style="font-size: 8pt;"&gt;{&amp;lt;peendtnum&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=(&lt;SPAN style="font-size: 8pt;"&gt;vPeendtnum&lt;/SPAN&gt;))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;/SPAN&gt;hrsbudmth)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:14:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409425#M152242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-05T15:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409426#M152243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've just tried to create the variable within the load statement but the variable comes back with nothing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD pe,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; peendt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(peendt) as peendtnum;&lt;/P&gt;&lt;P&gt;SQl seelct ........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vPeendtnum=Max({1}peendtnum);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting very confused now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:53:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409426#M152243</guid>
      <dc:creator />
      <dc:date>2013-03-05T15:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409427#M152244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do not create the variable in the script, once you are on the sheet, you can create it with CTRL+ALT+V &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409427#M152244</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-05T16:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409428#M152245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bobby!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've now created the variable as per your previous post. Just one final question, if I wanted to go back one month could I take the variable I have created but add -35?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so it would read &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({peendt=,pe=,peendtnum={$(=(vPeendtnum&lt;STRONG&gt;-35&lt;/STRONG&gt;))}&amp;gt;} hrsbudmth)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:56:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409428#M152245</guid>
      <dc:creator />
      <dc:date>2013-03-05T16:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409429#M152246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can but why -35 ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should add -30 or -31 depending on the month.&lt;/P&gt;&lt;P&gt;Actually, you have to add the number of days you want to go back from your variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 17:04:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409429#M152246</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-05T17:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409430#M152247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry yes you are correct bobbyraj_sg it should be -30 or -31 (unless Feb when its -28).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now have another query. If I'm coding the dates as numbers so Jan is 41305 and Feb is 41333 (difference of 28).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some clever trick where in my formula for Jan (Previous month) instead of having to manually change the -28 each month dependent on the number of days (either -30 or -31) from month to month to be a set expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;=sum({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;peendt&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;pe&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;peendtnum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG style="color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;&lt;STRONG style="color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;$(=(vPeendtnum-28))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effectively I think I need to create another variable but able to look at the 2nd max month!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;({1}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;peendtnum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this makes sense?!?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 10:41:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409430#M152247</guid>
      <dc:creator />
      <dc:date>2013-03-06T10:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409431#M152248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use fonctions like addmonths to add or remove the number of month you want to a given date. Then you can convert it to num.&lt;/P&gt;&lt;P&gt;Hope this can help you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 11:10:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/409431#M152248</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-06T11:10:15Z</dc:date>
    </item>
  </channel>
</rss>

