<?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 Analysis with If() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311757#M497166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still think there's an underlying problem with the data model--the "BusinessUnit_Description" and "Desc" are not linked properly between themselves. You can try this expression, but the total is slightly different:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(&lt;BR /&gt;if(match(CostElement,'R1','R2','R3','R4'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={"&amp;lt;=$(=Only(RM1_Period))"}&amp;gt;} RM1_Period_Value),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={$(=Only(RM1_Period))}&amp;gt;} RM1_Period_Value)&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;,Desc,BusinessUnit_Description))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you can "trick" QlikView into showing you one expression for the total row and a different one for the cell rows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Dimensionality()&amp;lt;&amp;gt;0,&lt;/P&gt;&lt;P&gt; sum(aggr(&lt;/P&gt;&lt;P&gt; if(match(CostElement,'R1','R2','R3','R4'),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={"&amp;lt;=$(=Only(RM1_Period))"}&amp;gt;} RM1_Period_Value),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={$(=Only(RM1_Period))}&amp;gt;} RM1_Period_Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; )&lt;/P&gt;&lt;P&gt; ,BusinessUnit_Description,Desc)),&lt;/P&gt;&lt;P&gt; sum(aggr(&lt;/P&gt;&lt;P&gt; if(match(CostElement,'R1','R2','R3','R4'),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={"&amp;lt;=$(=Only(RM1_Period))"}&amp;gt;} RM1_Period_Value),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={$(=Only(RM1_Period))}&amp;gt;} RM1_Period_Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; )&lt;/P&gt;&lt;P&gt; ,Desc))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, once you start writing expressions like this, the application quickly spins out of control. I suggest you start by investigating why showing BusinessUnit_Description and Desc in the same chart leads to different results that just using Desc as a dimension. My guess would be that it has something to do with the density of BusinessUnit_ID (that it's populated 72% of the time while CostElement is populated 67%).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Oct 2011 14:21:09 GMT</pubDate>
    <dc:creator>vgutkovsky</dc:creator>
    <dc:date>2011-10-06T14:21:09Z</dc:date>
    <item>
      <title>Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311749#M497158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Dear All,&lt;/P&gt;&lt;P&gt;I have a problem with a Set Analysis. Actually, a want in some cases to get the results of one Set Analysis ELSE get the result of another. Cause is a little bit more complicated (at least in my head right now!), I attached a sample. I want to get the results in pivot table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advanced,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 15:04:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311749#M497158</guid>
      <dc:creator>eleni_theodorid</dc:creator>
      <dc:date>2011-10-04T15:04:34Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311750#M497159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eleni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This approach won't work unfortunately. What you should keep in mind about set analysis is that it is calculated once per chart. For that reason, you can't use it to check which dimension you are currently in--only a conditional function like IF can do that. However, if I understand your question, this syntax should do the same thing more elegantly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(match(CostElement,'R1','R2','R3','R4'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={"&amp;lt;=$(=Only(RM1_Period))"}&amp;gt;} RM1_Period_Value),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={$(=Only(RM1_Period))}&amp;gt;} RM1_Period_Value)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 15:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311750#M497159</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2011-10-04T15:40:38Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311751#M497160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Vlad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all I want to thank you for your quick response. Your suggestion it would be the answer to my problem only if in the pivot table we get the correct number to the total (which is the most important for me).&lt;/P&gt;&lt;P&gt;Am I doing something wrong? Do you have to suggest anything else?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 16:11:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311751#M497160</guid>
      <dc:creator>eleni_theodorid</dc:creator>
      <dc:date>2011-10-04T16:11:33Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311752#M497161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the incorrect total is being caused by a problem with your data model--you have a synthetic key table in there. Try to get rid of that so your CostData and ProdKilos tables are linked to each other by 1 key only.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 16:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311752#M497161</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2011-10-04T16:36:55Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311753#M497162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Vlad,&lt;/P&gt;&lt;P&gt;I'm gonna try this and i will inform you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 07:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311753#M497162</guid>
      <dc:creator>eleni_theodorid</dc:creator>
      <dc:date>2011-10-05T07:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311754#M497163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Vlad,&lt;/P&gt;&lt;P&gt;although I have avoid the Synthetic Key and the Data Model is ok, the total of this expression in the pivot table display false results (the total in the Straight table is correct). Practicaly, it seems to do Expression Total instead of sum of Rows although in Total Mode the sum of Rows is marked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 11:16:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311754#M497163</guid>
      <dc:creator>eleni_theodorid</dc:creator>
      <dc:date>2011-10-05T11:16:07Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311755#M497164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want sum of rows in a pivot table to match your current logic for the straight table, you would need to replace the expression with something like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(&lt;BR /&gt;if(match(CostElement,'R1','R2','R3','R4'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={"&amp;lt;=$(=Only(RM1_Period))"}&amp;gt;} RM1_Period_Value),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={$(=Only(RM1_Period))}&amp;gt;} RM1_Period_Value)&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;,Desc))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But make sure this is actually what you want and it's not double-counting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 18:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311755#M497164</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2011-10-05T18:08:48Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311756#M497165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vlad,&lt;/P&gt;&lt;P&gt;I want to thanks you one more time for your response.&lt;/P&gt;&lt;P&gt;I have already tried this but if you put it in the chart you will see that although the total are right, all the other values (cell values) are wrong. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 06:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311756#M497165</guid>
      <dc:creator>eleni_theodorid</dc:creator>
      <dc:date>2011-10-06T06:53:02Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with If()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311757#M497166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still think there's an underlying problem with the data model--the "BusinessUnit_Description" and "Desc" are not linked properly between themselves. You can try this expression, but the total is slightly different:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(&lt;BR /&gt;if(match(CostElement,'R1','R2','R3','R4'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={"&amp;lt;=$(=Only(RM1_Period))"}&amp;gt;} RM1_Period_Value),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={$(=Only(RM1_Period))}&amp;gt;} RM1_Period_Value)&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;,Desc,BusinessUnit_Description))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you can "trick" QlikView into showing you one expression for the total row and a different one for the cell rows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Dimensionality()&amp;lt;&amp;gt;0,&lt;/P&gt;&lt;P&gt; sum(aggr(&lt;/P&gt;&lt;P&gt; if(match(CostElement,'R1','R2','R3','R4'),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={"&amp;lt;=$(=Only(RM1_Period))"}&amp;gt;} RM1_Period_Value),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={$(=Only(RM1_Period))}&amp;gt;} RM1_Period_Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; )&lt;/P&gt;&lt;P&gt; ,BusinessUnit_Description,Desc)),&lt;/P&gt;&lt;P&gt; sum(aggr(&lt;/P&gt;&lt;P&gt; if(match(CostElement,'R1','R2','R3','R4'),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={"&amp;lt;=$(=Only(RM1_Period))"}&amp;gt;} RM1_Period_Value),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt;RM1_Year={$(=Only(RM1_Year))}, RM1_Period={$(=Only(RM1_Period))}&amp;gt;} RM1_Period_Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; )&lt;/P&gt;&lt;P&gt; ,Desc))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, once you start writing expressions like this, the application quickly spins out of control. I suggest you start by investigating why showing BusinessUnit_Description and Desc in the same chart leads to different results that just using Desc as a dimension. My guess would be that it has something to do with the density of BusinessUnit_ID (that it's populated 72% of the time while CostElement is populated 67%).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 14:21:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-If/m-p/311757#M497166</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2011-10-06T14:21:09Z</dc:date>
    </item>
  </channel>
</rss>

