<?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 If Statement and Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234486#M499795</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;Many thanks for your quick reply. Unfortunately COST1 isn't quite that straightforward it looks more like the below so with several to add in it's going to get messy in the Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Measured='Measured' and (only(left([AccountNo],4))='A900' or only(left([AccountNo],4))='S001'),sum(QTY * NotionalCostMeasured * LINK_TO_STOCK), if(StockCode='1307',(sum(CCost)/LINK_TO_STOCK),sum(CCost))) + sum(QTY * [NAVNotionalCost]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Apr 2011 21:57:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-28T21:57:21Z</dc:date>
    <item>
      <title>If Statement and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234484#M499793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have two problems but probably only need one of them solving.&lt;/P&gt;&lt;P&gt;I am trying to add sets of costs based on a product group, 2 product groups fall into the same category and all the rest in the second category.&lt;/P&gt;&lt;P&gt;Previously I created expressions for all the individual costs and then used an IF statement to add them together such as&lt;/P&gt;&lt;P&gt;=IF([ProductGroup] ='023' or [ProductGroup]='025', [COST1]+[COST2], [COST3]+[COST4])&lt;/P&gt;&lt;P&gt;where [COST1] , [COST2] etc are expressions within the chart.&lt;/P&gt;&lt;P&gt;This works fine for individual lines but for the partial sum I get the sum of the else clause ie just [COST3]+[COST4]&lt;/P&gt;&lt;P&gt;If I use set analysis and try enter [COST1] , [COST2] etc I get Bad Field name so assume I can't use an expression within the set analysis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I say line by line this works with the if Statement but not for the total. Any ideas much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 21:32:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234484#M499793</guid>
      <dc:creator />
      <dc:date>2011-04-28T21:32:00Z</dc:date>
    </item>
    <item>
      <title>If Statement and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234485#M499794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can not use chart expressions inside set analysis.&lt;/P&gt;&lt;P&gt;If you are using straight table you can set the expression to be sum of lines intead of expression total (check on the right side of the tab 'Expressions' when you select each expression.&lt;/P&gt;&lt;P&gt;Maybe you could rewrite the expressions to have a total that makes sense.&lt;/P&gt;&lt;P&gt;if COST1= sum(COST1), your set analysis would be sum( {&amp;lt;[ProductGroup]={'023','025'}&amp;gt;} COST1) and so on...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 21:40:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234485#M499794</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-04-28T21:40:43Z</dc:date>
    </item>
    <item>
      <title>If Statement and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234486#M499795</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;Many thanks for your quick reply. Unfortunately COST1 isn't quite that straightforward it looks more like the below so with several to add in it's going to get messy in the Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Measured='Measured' and (only(left([AccountNo],4))='A900' or only(left([AccountNo],4))='S001'),sum(QTY * NotionalCostMeasured * LINK_TO_STOCK), if(StockCode='1307',(sum(CCost)/LINK_TO_STOCK),sum(CCost))) + sum(QTY * [NAVNotionalCost]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 21:57:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234486#M499795</guid>
      <dc:creator />
      <dc:date>2011-04-28T21:57:21Z</dc:date>
    </item>
    <item>
      <title>If Statement and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234487#M499796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about the other option? Is it a straight table where you can set the total mode for expressions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another option would be to use aggr() like this:&lt;/P&gt;&lt;P&gt;=sum( aggr( your_original_expression_here), dimension_on_chart1,dimension_on_chart2, ...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 22:04:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234487#M499796</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-04-28T22:04:48Z</dc:date>
    </item>
    <item>
      <title>If Statement and Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234488#M499797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Erich, it was a Pivot table but not for any real reason, set to Straight table and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will try the aggr() too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 22:28:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-and-Set-Analysis/m-p/234488#M499797</guid>
      <dc:creator />
      <dc:date>2011-04-28T22:28:03Z</dc:date>
    </item>
  </channel>
</rss>

