<?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: help with set analysis + expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379221#M571982</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, one field modifier per field in a set expression. But you can add the clearing of company like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;Company={"=sum({&lt;STRONG&gt;&amp;lt;Company=&amp;gt;}&lt;/STRONG&gt;Expenses)&amp;gt;0"}&amp;gt;} Expenses)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2012 10:46:53 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-08-21T10:46:53Z</dc:date>
    <item>
      <title>help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379216#M571977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 reference lines in my bar chart. The one displays the minimum expeses per FTE the other the average expenses over all companys. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created the minimum reference using the following expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Min({&amp;lt;Company=&amp;gt;} Aggr(sum({&amp;lt;Company=&amp;gt;} if(Expenses&amp;gt;0,&amp;nbsp; Expenses)) &lt;/P&gt;&lt;P&gt;/ sum({&amp;lt;Company=&amp;gt;}&amp;nbsp; if(Expenses&amp;gt;0,&amp;nbsp; FTE)),Company))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you can see the company field selection is ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm trying to get the total average of all the companys fixed as a refference line. But I find it difficult to generate the right expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached a qv sample what I would like to achieve &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope any one can help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 13:49:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379216#M571977</guid>
      <dc:creator />
      <dc:date>2012-08-20T13:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379217#M571978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are looking for the 149 €?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;Company=, Expenses={"&amp;gt;0"}&amp;gt;}Expenses) / sum({&amp;lt;Company=, Expenses={"&amp;gt;0"}&amp;gt;}FTE)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you want to disregard any selections:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({1&amp;lt;Expenses={"&amp;gt;0"}&amp;gt;}Expenses) / sum({1&amp;lt;Expenses={"&amp;gt;0"}&amp;gt;}FTE)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 14:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379217#M571978</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-20T14:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379218#M571979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks stefan!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works on my test file, with test data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I realised that the moment I sum everyting that's above 0, &lt;/P&gt;&lt;P&gt;I would get an invalid result.&lt;/P&gt;&lt;P&gt;This is because the companys are often charging each other for other services, &lt;/P&gt;&lt;P&gt;which has an affect on the total expenses per company.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say that company A has made 100.000 euros expenses this year. However since they offered various of services, -30.000 is registered as a service and deducated of the 100.000 euro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I would do a sum({&amp;lt;expenses={"&amp;gt;0"}&amp;gt;} expenses) company A would display 100.000 euros instead of 70.000 euros. Sum(expenses) would be the right thing to do. However, there are companys that have a total negative value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these are the companys that need to be excluded. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came up with a new expression: hoping to exlude the negative values per company. But that didn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=money(sum({&amp;lt;journaalBedrag={"&amp;gt;0"}&amp;gt;} Total aggr(sum(journaalBedrag),&amp;nbsp; Divisie)), '€ #.##0')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I did is first sum the expenses over the dimension Company, then using set analysis, I tried to exclud the companys that have a negative value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that didn't work using this expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've posted a new QV file with a new data. Hopefully this would clearify the above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 08:56:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379218#M571979</guid>
      <dc:creator />
      <dc:date>2012-08-21T08:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379219#M571980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;Company={"=sum(Expenses)&amp;gt;0"}&amp;gt;} Expenses)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;Company={"=sum(Expenses)&amp;gt;0"}&amp;gt;} FTE)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 09:02:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379219#M571980</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-21T09:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379220#M571981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help! That I indeed displayed the right results: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've added company to ignore company selections. However that doesn't work. The expression seem right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;&lt;STRONG&gt;Company=&lt;/STRONG&gt;, Company={"=sum(Expenses)&amp;gt;0"}&amp;gt;} Expenses)&amp;nbsp; / sum({&amp;lt;&lt;STRONG&gt;Company=&lt;/STRONG&gt;, Company={"=sum(Expenses)&amp;gt;0"}&amp;gt;} FTE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help so far!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 10:06:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379220#M571981</guid>
      <dc:creator />
      <dc:date>2012-08-21T10:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379221#M571982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, one field modifier per field in a set expression. But you can add the clearing of company like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;Company={"=sum({&lt;STRONG&gt;&amp;lt;Company=&amp;gt;}&lt;/STRONG&gt;Expenses)&amp;gt;0"}&amp;gt;} Expenses)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 10:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379221#M571982</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-21T10:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379222#M571983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stefan! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;That indeed did the job!!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 12:12:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379222#M571983</guid>
      <dc:creator />
      <dc:date>2012-08-21T12:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379223#M571985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for asking you again, but im quit new to set analysis. I'm trying to add the last yearmonth. &lt;/P&gt;&lt;P&gt;I tried the expression below, but it doesnt work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum({&amp;lt;Company={"=sum({&lt;STRONG&gt;&amp;lt;Company=, YearMonth={$(=(max(&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;YearMonth))&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;gt;}&lt;/STRONG&gt;Expenses)&amp;gt;0"}&amp;gt;} Expenses)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum({&amp;lt;Company={"=sum({&lt;STRONG&gt;&amp;lt;Company=, YearMonth={$(=(max(&lt;/STRONG&gt;&lt;STRONG&gt;YearMonth))&lt;/STRONG&gt;&lt;STRONG&gt;&amp;gt;}&lt;/STRONG&gt;Expenses)&amp;gt;0"}&amp;gt;} FTE)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This one below doesnt work either:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Company={"=sum({&amp;lt;Company=&amp;gt;}Expenses)&amp;gt;0"}, &lt;/P&gt;&lt;P&gt; YearMonth={$(=(max(YearMonth))&amp;gt;} Expenses)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Company={"=sum({&amp;lt;Company=&amp;gt;}Expenses)&amp;gt;0"}, &lt;/P&gt;&lt;P&gt; YearMonth={$(=(max(YearMonth))&amp;gt;} FTE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Hope u can help me out!&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Cheers Carter!&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 13:47:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379223#M571985</guid>
      <dc:creator />
      <dc:date>2012-08-23T13:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379224#M571988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you say, it doesn't work, what do you mean? Do you say wrong results or nothing at all? If you see wrong results, what do you expect to see?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the format of YearMonth? Set analysis is a bit picky here, you need to return the modifier list values in the exact same format then used for the field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, you might need to apply the set expression to both sums, depending on if you want to restrict the used Companies as well as the returned Expenses by max YearMonth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would probably be easiest if you could expand your small sample from above to the new field, then post it again and attach also your expected outcome.&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>Thu, 23 Aug 2012 17:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379224#M571988</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-23T17:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379225#M571991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the vague explation. I'm trying to get the latest year month selection fixed in Qlikview, ignoring the yearmonth selection. However Qlikview does not give me the right output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've used the expression below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num(sum({&amp;lt;Company={"=sum({&amp;lt;Company=, &lt;STRONG&gt;YearMonth={$(=max(YearMonth))}, YearMonth=&lt;/STRONG&gt;&amp;gt;} Expenses)&amp;gt;0"}&amp;gt;} Expenses) / sum({&amp;lt;Company={"=sum({&amp;lt;Company=, &lt;STRONG&gt;YearMonth={$(=max(YearMonth))}, YearMonth&lt;/STRONG&gt;=&amp;gt;}Expenses)&amp;gt;0"}&amp;gt;} FTE), '€ #.##0')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I select 201205 It gives me the the results of that month, which is some I don't want. Therefore I've added 'YearMonth=', to ignore the selection and always get the latest month regardsless of my selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same goes for the lowest value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Min({&amp;lt;Company=, YearMonth=, YearMonth={$(=max(YearMonth))}&amp;gt;}&lt;/STRONG&gt; Aggr(sum({&amp;lt;Company=, YearMonth={$(=max(YearMonth))}&amp;gt;} if(Expenses&amp;gt;0,&amp;nbsp; Expenses)) &lt;/P&gt;&lt;P&gt;/ sum({&amp;lt;Company=, YearMonth={$(=max(YearMonth))}&amp;gt;}&amp;nbsp; if(Expenses&amp;gt;0,&amp;nbsp; FTE)),Company))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached a sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope u can help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2012 11:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379225#M571991</guid>
      <dc:creator />
      <dc:date>2012-08-27T11:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis + expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379226#M571992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the solution. I had to add another set analysis in the expression below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Company={"=sum({&amp;lt;Company=, &lt;STRONG&gt;YearMonth={$(=max({&amp;lt;YearMonth=&amp;gt;}YearMonth))}&lt;/STRONG&gt;&amp;gt;} Expenses)&amp;gt;0"}&amp;gt;} Expenses).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping me with the previous posts, I really appricate it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2012 20:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-set-analysis-expression/m-p/379226#M571992</guid>
      <dc:creator />
      <dc:date>2012-08-27T20:54:54Z</dc:date>
    </item>
  </channel>
</rss>

