<?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 Pivot Table If Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217711#M70897</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your order key field called? It looks like it is quadrupling the value and you just want the normal value? Aggr() by Order Key.&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=money(Aggr(sum(&lt;BR /&gt; if( (complete='N' AND completed='N') AND&lt;BR /&gt; (match(disposition,'B','D','null','S')),&lt;BR /&gt;(extPrice_Ord -(comCost_Ord*qty_ordered_Ord))), ORDER_KEY))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Feb 2011 17:36:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-02-17T17:36:52Z</dc:date>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217707#M70893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like a pivot table column (just one column) to reduce some of the data similar to how selecting on a list box or applying a bookmark does. I tried rewriting my logic in a few different ways but keeping getting the same solution. I have a feeling it is not fully applying my logic.&lt;/P&gt;&lt;P&gt;I would like Orders in this column to have complete/completed flag = N and the below dispositions to be meet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;=sum(if(complete='N' OR completed='N' OR disposition = 'B' OR disposition = 'D' OR disposition = 'null' OR disposition = 'S',&lt;BR /&gt;(qty_ordered_Ord-qty_canceled_Ord)*unit_price_Ord))&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Is this correct way of writing this? Any other ideas? I am not opposed to use Set Analysis I just find using if then logic to be easier.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Thanks for any help you are able to provide.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Feb 2011 22:34:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217707#M70893</guid>
      <dc:creator />
      <dc:date>2011-02-15T22:34:26Z</dc:date>
    </item>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217708#M70894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That way works fine. Set Analysis should make expressions faster and easier to work with. That being said, if your expression is working, it isn't causing any delays and you understand exactly how it works, then you're probably doing it right. I wouldn't switch it to Set Analysis unless there was a valid reason. There may be a QlikView function that could handle that logic, but since there are three different fields being evaluated, the if is probably a good way to do it.&lt;/P&gt;&lt;P&gt;If Unit_Proce_Ord is a global value (not different from record to record), then taking it out of the Sum may increase the speed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Feb 2011 23:02:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217708#M70894</guid>
      <dc:creator />
      <dc:date>2011-02-15T23:02:49Z</dc:date>
    </item>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217709#M70895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nothing is wrong with the formula, but are you sure you don't want to put an "AND" between completed and disposition? I understood this in your plain English explanation "to have the complete/completed flag = N and the below dispositions to be met"&lt;/P&gt;&lt;P&gt;=sum(if( (complete='N' OR completed='N') AND (disposition = 'B' OR disposition = 'D' OR disposition = 'null' OR disposition = 'S'), (qty_ordered_Ord-qty_canceled_Ord)*unit_price_Ord))&lt;/P&gt;&lt;P&gt;or easier&lt;/P&gt;&lt;P&gt;=sum(if( (complete='N' OR completed='N') AND (match(disposition,'B','D','null','S')), (qty_ordered_Ord-qty_canceled_Ord)*unit_price_Ord))&lt;/P&gt;&lt;P&gt;Be careful with the null value. If null is a string the above formula is ok, but if it is the null value then use the function isnull()&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Feb 2011 23:04:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217709#M70895</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2011-02-15T23:04:45Z</dc:date>
    </item>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217710#M70896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay this is 'working' but I realize it is doing the math incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;//equals $28,714 correct with 'flags' applied to it&lt;BR /&gt;=money(sum((qty_ordered_Ord-qty_canceled_Ord)*unit_price_Ord))&lt;BR /&gt;//equals $114,856 inside pivot table it is summing each 'line item' on order. This order happens to have 4 line items to it adding all four of these&lt;BR /&gt;=money(sum(if( (complete='N' AND completed='N') AND (match(disposition,'B','D','null','S')), (extPrice_Ord -(comCost_Ord*qty_ordered_Ord)))))&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 17:14:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217710#M70896</guid>
      <dc:creator />
      <dc:date>2011-02-17T17:14:17Z</dc:date>
    </item>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217711#M70897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your order key field called? It looks like it is quadrupling the value and you just want the normal value? Aggr() by Order Key.&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=money(Aggr(sum(&lt;BR /&gt; if( (complete='N' AND completed='N') AND&lt;BR /&gt; (match(disposition,'B','D','null','S')),&lt;BR /&gt;(extPrice_Ord -(comCost_Ord*qty_ordered_Ord))), ORDER_KEY))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 17:36:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217711#M70897</guid>
      <dc:creator />
      <dc:date>2011-02-17T17:36:52Z</dc:date>
    </item>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217712#M70898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Order_no is the key. This is not working. Cause each order_no has multiple line items?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=money(Aggr(sum(&lt;BR /&gt; if( (complete='N' AND completed='N') AND (match(disposition,'B','D','null','S')), (extPrice_Ord -(comCost_Ord*qty_ordered_Ord)))), order_no))&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 17:45:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217712#M70898</guid>
      <dc:creator />
      <dc:date>2011-02-17T17:45:11Z</dc:date>
    </item>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217713#M70899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The if tends to duplicate data if the condition is not at the same detail level as the fields you are summing, so I would try NMiller's suggestion because the logic might get complicated in set analysis. I think it would be something like the following:&lt;/P&gt;&lt;P&gt;sum( { $&amp;lt;complete={'N'}, disposition={'B','D','null','S'}&amp;gt; + $&amp;lt;completed={'N'}, disposition={'B','D','null','S'}&amp;gt;} (qty_ordered_Ord-qty_canceled_Ord)*unit_price_Ord))&lt;/P&gt;&lt;P&gt;You might be able to simplify the logic.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 17:47:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217713#M70899</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2011-02-17T17:47:20Z</dc:date>
    </item>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217714#M70900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm. Somewhat closer. Now it is not displaying all the order amounts as it should. Not sure what it is missing. Playing around with the set analysis. Nmiller did not calculate when I put the order_no as the key. See above post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt;money(sum( { $&amp;lt;complete={'N'}, disposition={'B','D','Null','S'}&amp;gt; + $&amp;lt;completed={'N'}, disposition={'B','D','Null','S'}&amp;gt;}&lt;BR /&gt; (qty_ordered_Ord-qty_canceled_Ord)*unit_price_Ord))&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 18:04:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217714#M70900</guid>
      <dc:creator />
      <dc:date>2011-02-17T18:04:13Z</dc:date>
    </item>
    <item>
      <title>Pivot Table If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217715#M70901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked. Just had to play with (). See below post. Thanks for all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 18:08:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-If-Expression/m-p/217715#M70901</guid>
      <dc:creator />
      <dc:date>2011-02-17T18:08:44Z</dc:date>
    </item>
  </channel>
</rss>

