<?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 Set analisis + if in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analisis-if/m-p/763715#M660065</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 would like to filter one expression with if, but &lt;SPAN style="color: #575757;"&gt;&lt;STRONG style=": ; color: #575757; text-decoration: underline;"&gt;without changin the variable&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;v%Waste= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Sum(Aggr(Sum ({&amp;lt;TIPO={"Waste"}&amp;gt;}&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Quantity&lt;/SPAN&gt;),Day,Supplier))/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum(Aggr(Sum ({&amp;lt;TIPO={"Consumes"}&amp;gt;}Quantity),&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Day,Supplier&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the expression to filter is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(10-($(v%Waste)-0.01)*1000&amp;gt;10,10,If(10-($(v%Waste)-0.01)*1000&amp;lt;0,0,10-($(v%Waste)-0.01)*1000))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works well alone but when I&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; tried this expression filtering by day&amp;gt;31/12/2014 and &amp;lt; actual month doesn´t work:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;Day= {"&amp;gt;31/12/2014"},MonthYear={"&amp;lt;Date(MonthStart(Today()),'MMM-YY'))"}&amp;gt;} $(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;v%Waste)&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could somebody help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the personal edition, therefore I can not open qlikview examples. Please, send me the corrections in the formuls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Mar 2015 13:19:55 GMT</pubDate>
    <dc:creator>inigoelv</dc:creator>
    <dc:date>2015-03-21T13:19:55Z</dc:date>
    <item>
      <title>Set analisis + if</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analisis-if/m-p/763715#M660065</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 would like to filter one expression with if, but &lt;SPAN style="color: #575757;"&gt;&lt;STRONG style=": ; color: #575757; text-decoration: underline;"&gt;without changin the variable&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;v%Waste= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Sum(Aggr(Sum ({&amp;lt;TIPO={"Waste"}&amp;gt;}&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Quantity&lt;/SPAN&gt;),Day,Supplier))/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum(Aggr(Sum ({&amp;lt;TIPO={"Consumes"}&amp;gt;}Quantity),&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Day,Supplier&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the expression to filter is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(10-($(v%Waste)-0.01)*1000&amp;gt;10,10,If(10-($(v%Waste)-0.01)*1000&amp;lt;0,0,10-($(v%Waste)-0.01)*1000))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works well alone but when I&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; tried this expression filtering by day&amp;gt;31/12/2014 and &amp;lt; actual month doesn´t work:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;Day= {"&amp;gt;31/12/2014"},MonthYear={"&amp;lt;Date(MonthStart(Today()),'MMM-YY'))"}&amp;gt;} $(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;v%Waste)&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could somebody help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the personal edition, therefore I can not open qlikview examples. Please, send me the corrections in the formuls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Mar 2015 13:19:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analisis-if/m-p/763715#M660065</guid>
      <dc:creator>inigoelv</dc:creator>
      <dc:date>2015-03-21T13:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set analisis + if</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analisis-if/m-p/763716#M660066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This couldn't work because it is a nested aggregation without an aggr. You need to add the aggr or to put the extra condition inside the variable-expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;Day= {"&amp;gt;31/12/2014"},MonthYear={"&amp;lt;Date(MonthStart(Today()),'MMM-YY'))"}&amp;gt;} aggr($(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;v%Waste)&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Day,Supplier&lt;/SPAN&gt;)&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Sum(Aggr(Sum ({&amp;lt;TIPO={"Waste"}, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day= {"&amp;gt;31/12/2014"},MonthYear={"&amp;lt;Date(MonthStart(Today()),'MMM-YY'))"}&amp;gt;}&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Quantity&lt;/SPAN&gt;),Day,Supplier)) /&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum(Aggr(Sum ({&amp;lt;TIPO={"Consumes"},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day= {"&amp;gt;31/12/2014"},MonthYear={"&amp;lt;Date(MonthStart(Today()),'MMM-YY'))"}&amp;gt;}Quantity),&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Day,Supplier&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further the extra condition looks a little bit strange. It compared a day with a date and a period with a date - I think it should more look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... Date= {"&amp;gt;'31/12/2014'&amp;lt;$(=Date(MonthStart(Today()),'DD/MM/YYYY'))"}&amp;gt;} ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if it's a single expression to use a variable for this adds no advantages. If you used this kind of expression often you could flexibilize such expression-variables with parameter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/617782#617782" title="http://community.qlik.com/message/617782#617782"&gt;http://community.qlik.com/message/617782#617782&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/610606#610606" title="http://community.qlik.com/message/610606#610606"&gt;http://community.qlik.com/message/610606#610606&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Mar 2015 14:40:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analisis-if/m-p/763716#M660066</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-03-21T14:40:08Z</dc:date>
    </item>
  </channel>
</rss>

