<?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 Re: Sum values in table with different transaction types in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534059#M108316</link>
    <description>&lt;P&gt;Like hinted you just need to fill the SO records with the information from the CO records, for example with a mapping:&lt;/P&gt;&lt;P&gt;m: mapping load OrderID, ReasonCode from X where&amp;nbsp;&lt;SPAN&gt;DocType = 'CO';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;t: load *,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if(DocType = 'SO', applymap('m', OrderID, '#NV'),&amp;nbsp;ReasonCode) as&amp;nbsp;ReasonCodeX&lt;BR /&gt;from X;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Oct 2025 09:27:37 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2025-10-22T09:27:37Z</dc:date>
    <item>
      <title>Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533535#M108228</link>
      <description>&lt;P&gt;I have a table that contains two different types of transactions, credit orders ("CO") and sales orders ("SO").&lt;/P&gt;&lt;P&gt;I want to have a column that totals the CO dollars:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;DocType = {'CO'}&amp;gt;} ExtendedPrice)&lt;/P&gt;&lt;P&gt;And I want to have a column that totals the quantity originally sold:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;DocType={'SO'}&amp;gt;} ShippedQty)&lt;/P&gt;&lt;P&gt;The result I'm getting is incorrect. I'm seeing CO dollars of 0 when there are SO quantities &amp;gt; 0, and I'm seeing SO quantities of 0 when there are CO dollars &amp;gt;0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to see dollars and quantities summarized for each line in the table, but only when a dollar amount exists for the CO transaction. Instead, it looks like I'm getting lines for SO quantities when there isn't a related total for CO dollars (and vice versa).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_0-1760565278735.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/184257i182B75A15FE05B20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_0-1760565278735.png" alt="mikegrattan_0-1760565278735.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 21:55:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533535#M108228</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-15T21:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533562#M108230</link>
      <description>&lt;P&gt;you may use if(&lt;SPAN&gt;Sum({&amp;lt;DocType = {'CO'}&amp;gt;} ExtendedPrice)&amp;gt;0 ....then your logic.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;or/ and use the below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="robert_mika_0-1760585518056.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/184262i1D76D45C665C76F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="robert_mika_0-1760585518056.png" alt="robert_mika_0-1760585518056.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 03:32:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533562#M108230</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2025-10-16T03:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533600#M108237</link>
      <description>&lt;P&gt;The reason may be a not suitable relationship between the involved data - especially if they come from different tables.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 09:53:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533600#M108237</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-10-16T09:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533606#M108238</link>
      <description>&lt;P&gt;I'm not quite following what the problem is. Looking at the screen capture, it looks like each line is correct. The reason you never have both quantities and dollars in the same line is because each line has different dimensions. In particular, the Reason Code dimension seems to split out the returns into different lines.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 10:23:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533606#M108238</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2025-10-16T10:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533634#M108244</link>
      <description>&lt;P&gt;The data comes from the same table. The initial sales transaction has a doc type of SO but a credit can occur after that, so a new transaction will be added to the table with a CO doc type. The CO doc type can have a reason code that explains the reason for the credit.&lt;/P&gt;&lt;P&gt;My goal is to have one record per CO transaction for each Item Description, by Week and Year. On that same record I also want to show the sum total of the SO quantity for that item, in that week and year.&lt;/P&gt;&lt;P&gt;Perhaps an Aggr function is needed for the SO quantities?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 14:25:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533634#M108244</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-16T14:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533635#M108245</link>
      <description>&lt;P&gt;The Reason Code only applies to CO doc type transactions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to have one record per CO transaction for each Item Description, by Week and Year. On that same record I also want to show the sum total of the SO quantity for that item, in that week and year.&lt;/P&gt;&lt;P&gt;Perhaps an Aggr function is needed for the SO quantities?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 14:26:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533635#M108245</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-16T14:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533636#M108246</link>
      <description>&lt;P&gt;In that context, you would need to have something differentiating the CO transaction (ID or something similar) and then a set analysis to ignore the ID and Reason Code. You could also do that with aggr(), I think.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 14:38:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533636#M108246</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2025-10-16T14:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533638#M108247</link>
      <description>&lt;P&gt;For a quick check you could remove some dimensions from the table - maybe just to a single one like year or week to see if the price/quantity results are on a single row or not. And then adding the next dimension and so on until you get two rows again - which means you found the one which has not the right relationship.&lt;/P&gt;&lt;P&gt;Very helpful is usually a table-box with the related fields and without any aggregations.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 14:39:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533638#M108247</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-10-16T14:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533641#M108248</link>
      <description>&lt;P&gt;The Reason Code dimension is a requirement for the table on this sheet. I need to show the sum total of CO transactions in dollars for each Item Description by Week and ShipYear. You are correct that the SO transaction does not have a Reason Code and that could be why I'm struggling to get the correct SO quantity summed by the same dimensions, excluding the Reason Code.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 14:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533641#M108248</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-16T14:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533647#M108251</link>
      <description>&lt;P&gt;The If statement only gets me to a certain point - I do start to see more filtering overall and more data in the quantity column, but the quantities don't match what I'm seeing in my control table, which shows only the SO transactions for comparison.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 15:22:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533647#M108251</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-16T15:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533651#M108252</link>
      <description>&lt;P&gt;If it is required as a dimension, you will need your SO formula to include something to ignore that. Otherwise, you won't get any results. Not sure why it's required as a dimension, though... typically in this scenario it's easier to make it a measure. That said, they're your requirements.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 16:21:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533651#M108252</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2025-10-16T16:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533699#M108266</link>
      <description>&lt;P&gt;Displaying the reason code information as expression should be workable for this table and maybe even necessary if there are more as a single code possible in regard to the aggregation-level - which may be then done per concat(ReasonCode, ' + ').&lt;/P&gt;&lt;P&gt;Another consideration may go to fill for all DocType the ReasonCode - maybe even in an extra field. Of course such measurements are needing more efforts (extracting missing information in beforehand and applying them with n mappings) but it could simplify the UI significantly.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 06:01:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533699#M108266</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-10-17T06:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533987#M108309</link>
      <description>&lt;P&gt;There isn't a number that differentiates the CO and the SO - they are both related to the same sales order number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 17:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2533987#M108309</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-21T17:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534059#M108316</link>
      <description>&lt;P&gt;Like hinted you just need to fill the SO records with the information from the CO records, for example with a mapping:&lt;/P&gt;&lt;P&gt;m: mapping load OrderID, ReasonCode from X where&amp;nbsp;&lt;SPAN&gt;DocType = 'CO';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;t: load *,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if(DocType = 'SO', applymap('m', OrderID, '#NV'),&amp;nbsp;ReasonCode) as&amp;nbsp;ReasonCodeX&lt;BR /&gt;from X;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 09:27:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534059#M108316</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-10-22T09:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534146#M108331</link>
      <description>&lt;P&gt;I don't see how Reason Code would be anything else but a dimension - it's not something you can sum, avg, etc. because it's not a number and doesn't make sense as a measure.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 22:37:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534146#M108331</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-22T22:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534150#M108332</link>
      <description>&lt;P&gt;The reason code only applies to the CO transaction for the sales order. For example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_1-1761173088869.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/184397i7B84CFF388E9BAD7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_1-1761173088869.png" alt="mikegrattan_1-1761173088869.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example, sales order (SO) 12345 originated on 1/1/2025, 500 units were sold for $2,000. On 2/15/2025, a credit (CO) was issued for $1500 and the reason code recorded was RJQ.&lt;/P&gt;&lt;P&gt;For our report requirements, we want to list the credit amount, $1500, and the original quantity sold, 500, on the same row. So it would look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_2-1761173155281.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/184398i2ECA110858EA675E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_2-1761173155281.png" alt="mikegrattan_2-1761173155281.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 22:46:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534150#M108332</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-22T22:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534165#M108333</link>
      <description>&lt;P&gt;In this case the above hinted mapping would be part of the right approach to get the wanted information - whereby you may need n mappings to get all required information.&lt;/P&gt;&lt;P&gt;It's a quite common method whereby most of the advanced users will take other approaches like the detours with link-table data-models.&lt;/P&gt;&lt;P&gt;Some background - many ERP have fact-tables like orders + billing + shipment. Keeping these facts separately within a BI model leads to a lot of trouble because each one would need a connection to the dimensions which would result in synthetic keys and/or circular references between the facts/dimensions and/or they getting their own dimensions. Of course these challenges are solvable with a lot of extra efforts within complex UI expressions and synchronizing the selections - whereby it won't help by missing information and/or missing key-values between the facts (again solvable with calculated dimensions). Surely possible but it's rather a nightmare then a sensible solution.&lt;/P&gt;&lt;P&gt;Therefore are many using link-table data-models but like hinted it's mostly a detour because the concatenation of the facts could be done directly within a single fact-table. This avoids completely the challenges with linking the facts and dimensions.&lt;/P&gt;&lt;P&gt;But none of this will be enough to get such required information like described or to make an example again - the order-record of such fact-table will know it's OrderID but not a BillingID or ShipmentID. There are various scenarios thinkable to look from one fact-side to the others, like from the orders how many where already billed and similar which could be quite simple answered within a view if the order-records are filled with the existing&amp;nbsp;BillingID.&lt;/P&gt;&lt;P&gt;Essentially is the understanding that it may need x extracting/filling loads to get all needed information and that's not mandatory a weakness of the BI tool and/or the data-model and/or the data-set to apply such measurements else it's often the most pragmatic way to derive the not directly accessible information.&lt;/P&gt;&lt;P&gt;Your single task might be easier solvable as re-designing the data-model with switching dimension and expression and/or using an aggr() logic but if data needs to ordered and/or accumulated and/or (date/amount) offsets calculated between orders and/or billings ... and these ones flagged/scored and/or missing records needs to be populated it would be necessary to mandatory to do this work within the data-model and not within the UI.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2025 06:16:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534165#M108333</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-10-23T06:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values in table with different transaction types</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534216#M108339</link>
      <description>&lt;P&gt;The mapping approach is the answer - works great. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2025 18:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-values-in-table-with-different-transaction-types/m-p/2534216#M108339</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-10-23T18:10:24Z</dc:date>
    </item>
  </channel>
</rss>

