<?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 Conditional Aggr with multiple dimensions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Conditional-Aggr-with-multiple-dimensions/m-p/1425855#M34008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to build a rather complex expression in Qlik Sense Enterprise to produce a single measure for 'weight.' There are a few dimensions that determine HOW to &lt;STRONG&gt;group&lt;/STRONG&gt; the weights and they are based on related tables (one table more detailed than the other). Your guidance is much appreciated!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The high-level table (order_prod) is grouped by order_prod_id&lt;/P&gt;&lt;P&gt;The low-level table (order_prod_inv) is grouped by order_prod_inv_id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(distinct IF(&lt;/P&gt;&lt;P&gt;aggr(Sum(IF(Product_Type = 'Unit' and (category_id = 3 or category_id = 4 or category_id = 5), &lt;SPAN style="font-size: 13.3333px;"&gt;qty_base * &lt;/SPAN&gt;medicated_weight_base,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Product_Type = 'Unit' and category_id &amp;lt;&amp;gt; 2 and category_id &amp;lt;&amp;gt; 3 and category_id &amp;lt;&amp;gt; 4 and category_id &amp;lt;&amp;gt; 5, '0',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Product_Type = 'Prepack',&amp;nbsp; qty_base * weight_base,''))))), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order_prod_inv_id),&lt;/P&gt;&lt;P&gt;aggr(Sum(IF(Product_Type = 'Unit' and category_id = 2, quantity * sold_weight_base),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF(Product_Type = 'Bulk',&amp;nbsp; quantity * sold_weight_base, ''))),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order_prod_id,'')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Dec 2017 04:47:23 GMT</pubDate>
    <dc:creator>ryan_giebel</dc:creator>
    <dc:date>2017-12-05T04:47:23Z</dc:date>
    <item>
      <title>Conditional Aggr with multiple dimensions</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-Aggr-with-multiple-dimensions/m-p/1425855#M34008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to build a rather complex expression in Qlik Sense Enterprise to produce a single measure for 'weight.' There are a few dimensions that determine HOW to &lt;STRONG&gt;group&lt;/STRONG&gt; the weights and they are based on related tables (one table more detailed than the other). Your guidance is much appreciated!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The high-level table (order_prod) is grouped by order_prod_id&lt;/P&gt;&lt;P&gt;The low-level table (order_prod_inv) is grouped by order_prod_inv_id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(distinct IF(&lt;/P&gt;&lt;P&gt;aggr(Sum(IF(Product_Type = 'Unit' and (category_id = 3 or category_id = 4 or category_id = 5), &lt;SPAN style="font-size: 13.3333px;"&gt;qty_base * &lt;/SPAN&gt;medicated_weight_base,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Product_Type = 'Unit' and category_id &amp;lt;&amp;gt; 2 and category_id &amp;lt;&amp;gt; 3 and category_id &amp;lt;&amp;gt; 4 and category_id &amp;lt;&amp;gt; 5, '0',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(Product_Type = 'Prepack',&amp;nbsp; qty_base * weight_base,''))))), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order_prod_inv_id),&lt;/P&gt;&lt;P&gt;aggr(Sum(IF(Product_Type = 'Unit' and category_id = 2, quantity * sold_weight_base),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF(Product_Type = 'Bulk',&amp;nbsp; quantity * sold_weight_base, ''))),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order_prod_id,'')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 04:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-Aggr-with-multiple-dimensions/m-p/1425855#M34008</guid>
      <dc:creator>ryan_giebel</dc:creator>
      <dc:date>2017-12-05T04:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Aggr with multiple dimensions</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-Aggr-with-multiple-dimensions/m-p/1425856#M34009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be rather difficult to decipher this without a sample, would you be able to share a sample to check this out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 12:49:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-Aggr-with-multiple-dimensions/m-p/1425856#M34009</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-12-05T12:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Aggr with multiple dimensions</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-Aggr-with-multiple-dimensions/m-p/1425857#M34010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your interest, Sunny! My firm got hacked earlier this year so we are super sensitive about sharing anything right now. Can you tell me whether or not Qlik Sense allows for a conditional aggregate reflecting multiple dimensions in the same expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is a more rudimentary example of what I'm trying to accomplish with two conditions (containing different measures and grouped at different dimensions) in a single measure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#1 if product_type = 'unit' then sum(aggr(sum(qty_base * medicated_weight_base), &lt;STRONG&gt;order_prod_inv_id&lt;/STRONG&gt;),&lt;/P&gt;&lt;P&gt;#2 &lt;SPAN style="font-size: 13.3333px;"&gt;if product_type = 'prepack' then sum(aggr(sum(qty_base * weight_base), &lt;STRONG&gt;order_prod_id&lt;/STRONG&gt;),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;#3 null&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hope this provides a more comprehensive picture of what i'm trying to do. Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 15:45:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-Aggr-with-multiple-dimensions/m-p/1425857#M34010</guid>
      <dc:creator>ryan_giebel</dc:creator>
      <dc:date>2017-12-05T15:45:58Z</dc:date>
    </item>
  </channel>
</rss>

