<?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: select sets based on specific sum() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-select-sets-based-on-specific-sum/m-p/819206#M288829</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish to consult you if it is correct in set analyses.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I have 2 tables in QlikView, both related to the financial/invoicing process. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Table called 'FI' (or precisely BKPF-BSEG in SAP) ]&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="149" style="border: 1px solid #000000; width: 329px; height: 135px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;FiId&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;RC&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;FiDate&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;FiMonth&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Batch &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Cost&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/1/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jan15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1€&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Revenue&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3€&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Cost&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1€&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Revenue&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-3€&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Revenue&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3€&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Tokens are:&lt;/P&gt;&lt;P&gt;FiId = primary key, generated.&lt;/P&gt;&lt;P&gt;RC = either revenue or cost category.&lt;/P&gt;&lt;P&gt;Date = transaction date.&lt;/P&gt;&lt;P&gt;FiMonth = dual value, MonthName(FiDate).&lt;/P&gt;&lt;P&gt;Batch = product Identifier. In this example, '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Table called 'SD' (or precisely VBRK-P in SAP)]&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="102" style="border: 1px solid #000000; width: 281px; height: 104px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SdId&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Weight&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SdDate&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SdMonth&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Batch&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Feb15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Tokes for SD table is:&lt;/P&gt;&lt;P&gt;SdId = primary key, generated.&lt;/P&gt;&lt;P&gt;Weight = if it is invoice, +1, if reversed (such as credit note) -1.&lt;/P&gt;&lt;P&gt;SdDate = invoice issue date&lt;/P&gt;&lt;P&gt;SdMonth = dual value of MonthName(SdDate)&lt;/P&gt;&lt;P&gt;Batch = product&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;FI and SD is many-to-many relation (many SdId has many FiId). but in this case 1 &lt;SPAN style="text-decoration: underline;"&gt;Batch&lt;/SPAN&gt; has multiple &lt;SPAN style="text-decoration: underline;"&gt;SdId&lt;/SPAN&gt; and &lt;SPAN style="text-decoration: underline;"&gt;FiID&lt;/SPAN&gt;. User always selects SdMonth → (will lead to) set of &lt;SPAN style="text-decoration: underline;"&gt;Batch&lt;/SPAN&gt; → sets of &lt;SPAN style="text-decoration: underline;"&gt;FdId&lt;/SPAN&gt;, so I did not created any bridge table.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; → this point might be that I should create a table with group-by per &lt;SPAN style="text-decoration: underline;"&gt;SdMonth&lt;/SPAN&gt; per &lt;SPAN style="text-decoration: underline;"&gt;Batch&lt;/SPAN&gt; instead of current table construction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I must produce such aggregation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In SD table, sum &lt;SPAN style="text-decoration: underline;"&gt;Weight&lt;/SPAN&gt; per &lt;SPAN style="text-decoration: underline;"&gt;Batch Number&lt;/SPAN&gt; per selected month. If it were non-zero, sum all historical Cost item in FI table per batch number.&lt;/LI&gt;&lt;LI&gt;Besides, only select those batch, of which &lt;SPAN style="text-decoration: underline;"&gt;Revenue&lt;/SPAN&gt; (i.e. Sum({&amp;lt;RC={Revenue}&amp;gt;} Amount)) is positive or negative.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Firstly I have created SdMonth as selector on UI.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;IMG __jive_id="78309" alt="Error 1.jpg" class="image-1 jive-image" src="/legacyfs/online/78309_Error 1.jpg" style="height: 34px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;I have produced such set analysis, but I am not sure if it is really fine from technical perspective.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Sum(Weight)&amp;lt;&amp;gt;0,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;//Sun if Weight is non-zero on the selected month in the UI&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({$&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RC={Cost},&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;//select only Cost&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;FiMonth={"&amp;lt;=SdMonth"},&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Cumulative only up to the selected month&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Batch={"=Sum({&amp;lt;RC={Revenue}&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;gt;}Amount)&amp;lt;&amp;gt;0"}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Select batch, of which revenue is non-zero&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;gt;}Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the Revenue, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; RC={Revenue}, FiMonth=SdMonth&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;gt;} Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I would appreciate for your advices/feedback in advance for above set analysis. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;* * * [Background] * * *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Such requirement emerged when we wished to explore FBL3N in SAP transaction per GL account. Typically sales is initiated in SD module, and re-posted to FI. SD and FI not necessarily match it, so we do not merge SD and FI table. Above, 'Cost/Revenue' is precisely BSEG-HKONT, where actual GL account is assigned. &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Weight in SD table is based on VBRK-FKART, the document type. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cost must be cumulative amount, while revenue is generated in single month. To create explorative capability of gross profit, we ought to sum cost historically, while revenue should show only single month.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Feb 2015 09:17:32 GMT</pubDate>
    <dc:creator>atsushi_saijo</dc:creator>
    <dc:date>2015-02-17T09:17:32Z</dc:date>
    <item>
      <title>Set Analysis: select sets based on specific sum()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-select-sets-based-on-specific-sum/m-p/819206#M288829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish to consult you if it is correct in set analyses.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I have 2 tables in QlikView, both related to the financial/invoicing process. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Table called 'FI' (or precisely BKPF-BSEG in SAP) ]&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="149" style="border: 1px solid #000000; width: 329px; height: 135px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;FiId&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;RC&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;FiDate&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;FiMonth&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Batch &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Cost&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/1/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jan15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1€&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Revenue&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3€&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Cost&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1€&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Revenue&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-3€&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Revenue&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3€&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Tokens are:&lt;/P&gt;&lt;P&gt;FiId = primary key, generated.&lt;/P&gt;&lt;P&gt;RC = either revenue or cost category.&lt;/P&gt;&lt;P&gt;Date = transaction date.&lt;/P&gt;&lt;P&gt;FiMonth = dual value, MonthName(FiDate).&lt;/P&gt;&lt;P&gt;Batch = product Identifier. In this example, '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Table called 'SD' (or precisely VBRK-P in SAP)]&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="102" style="border: 1px solid #000000; width: 281px; height: 104px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SdId&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Weight&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SdDate&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;SdMonth&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Batch&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Feb15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13/2/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Feb15&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Tokes for SD table is:&lt;/P&gt;&lt;P&gt;SdId = primary key, generated.&lt;/P&gt;&lt;P&gt;Weight = if it is invoice, +1, if reversed (such as credit note) -1.&lt;/P&gt;&lt;P&gt;SdDate = invoice issue date&lt;/P&gt;&lt;P&gt;SdMonth = dual value of MonthName(SdDate)&lt;/P&gt;&lt;P&gt;Batch = product&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;FI and SD is many-to-many relation (many SdId has many FiId). but in this case 1 &lt;SPAN style="text-decoration: underline;"&gt;Batch&lt;/SPAN&gt; has multiple &lt;SPAN style="text-decoration: underline;"&gt;SdId&lt;/SPAN&gt; and &lt;SPAN style="text-decoration: underline;"&gt;FiID&lt;/SPAN&gt;. User always selects SdMonth → (will lead to) set of &lt;SPAN style="text-decoration: underline;"&gt;Batch&lt;/SPAN&gt; → sets of &lt;SPAN style="text-decoration: underline;"&gt;FdId&lt;/SPAN&gt;, so I did not created any bridge table.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; → this point might be that I should create a table with group-by per &lt;SPAN style="text-decoration: underline;"&gt;SdMonth&lt;/SPAN&gt; per &lt;SPAN style="text-decoration: underline;"&gt;Batch&lt;/SPAN&gt; instead of current table construction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I must produce such aggregation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In SD table, sum &lt;SPAN style="text-decoration: underline;"&gt;Weight&lt;/SPAN&gt; per &lt;SPAN style="text-decoration: underline;"&gt;Batch Number&lt;/SPAN&gt; per selected month. If it were non-zero, sum all historical Cost item in FI table per batch number.&lt;/LI&gt;&lt;LI&gt;Besides, only select those batch, of which &lt;SPAN style="text-decoration: underline;"&gt;Revenue&lt;/SPAN&gt; (i.e. Sum({&amp;lt;RC={Revenue}&amp;gt;} Amount)) is positive or negative.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Firstly I have created SdMonth as selector on UI.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;IMG __jive_id="78309" alt="Error 1.jpg" class="image-1 jive-image" src="/legacyfs/online/78309_Error 1.jpg" style="height: 34px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;I have produced such set analysis, but I am not sure if it is really fine from technical perspective.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Sum(Weight)&amp;lt;&amp;gt;0,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;//Sun if Weight is non-zero on the selected month in the UI&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({$&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RC={Cost},&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;//select only Cost&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;FiMonth={"&amp;lt;=SdMonth"},&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Cumulative only up to the selected month&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Batch={"=Sum({&amp;lt;RC={Revenue}&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;gt;}Amount)&amp;lt;&amp;gt;0"}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Select batch, of which revenue is non-zero&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;gt;}Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the Revenue, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; RC={Revenue}, FiMonth=SdMonth&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;gt;} Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I would appreciate for your advices/feedback in advance for above set analysis. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;* * * [Background] * * *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Such requirement emerged when we wished to explore FBL3N in SAP transaction per GL account. Typically sales is initiated in SD module, and re-posted to FI. SD and FI not necessarily match it, so we do not merge SD and FI table. Above, 'Cost/Revenue' is precisely BSEG-HKONT, where actual GL account is assigned. &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Weight in SD table is based on VBRK-FKART, the document type. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cost must be cumulative amount, while revenue is generated in single month. To create explorative capability of gross profit, we ought to sum cost historically, while revenue should show only single month.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 09:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-select-sets-based-on-specific-sum/m-p/819206#M288829</guid>
      <dc:creator>atsushi_saijo</dc:creator>
      <dc:date>2015-02-17T09:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: select sets based on specific sum()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-select-sets-based-on-specific-sum/m-p/819207#M288830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Atsushi,&lt;/P&gt;&lt;P&gt;QlikView will connect your two tables by using the Batch field, because it is the only field in both tables that has the same name. I asume that performance will not be very good because your tables have a many to many relationship and you probably have a lot of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you suggest, the aggregation on Batch, Weight and Month during Load might be a good idea.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Oliver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 09:40:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-select-sets-based-on-specific-sum/m-p/819207#M288830</guid>
      <dc:creator />
      <dc:date>2015-02-17T09:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: select sets based on specific sum()</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-select-sets-based-on-specific-sum/m-p/819208#M288831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Oliver for your comment. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 09:03:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-select-sets-based-on-specific-sum/m-p/819208#M288831</guid>
      <dc:creator>atsushi_saijo</dc:creator>
      <dc:date>2015-02-20T09:03:26Z</dc:date>
    </item>
  </channel>
</rss>

