<?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: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901652#M74385</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/114372"&gt;@HarryLouis&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;did you try the following:&lt;BR /&gt;Sum({1&amp;lt;Part=p(Part)&amp;gt;}Cost)&lt;BR /&gt;I selected here the aa raw material and I got in the table A -&amp;gt; 10 and B-&amp;gt;10&lt;BR /&gt;is this what you want to accomplish?&lt;BR /&gt;kindly advise&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 07:48:49 GMT</pubDate>
    <dc:creator>ali_hijazi</dc:creator>
    <dc:date>2022-03-07T07:48:49Z</dc:date>
    <item>
      <title>Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1900691#M74315</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I hope anyone can help me out with getting the set analyis / total correct on this. I have a table in my data model like below (simplified):&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Part&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;raw material&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;cost&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;aa&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;bb&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;B&lt;/TD&gt;
&lt;TD height="25px"&gt;aa&lt;/TD&gt;
&lt;TD height="25px"&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;C&lt;/TD&gt;
&lt;TD height="25px"&gt;cc&lt;/TD&gt;
&lt;TD height="25px"&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to output a table which sums the cost values of the raw material by Part:&lt;/P&gt;
&lt;TABLE border="1" width="32.21798780487805%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="26.097560975609756%"&gt;PN&lt;/TD&gt;
&lt;TD width="6.121654681592415%"&gt;total_cost&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="26.097560975609756%"&gt;A&lt;/TD&gt;
&lt;TD width="6.121654681592415%"&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="26.097560975609756%"&gt;B&lt;/TD&gt;
&lt;TD width="6.121654681592415%"&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="26.097560975609756%"&gt;C&lt;/TD&gt;
&lt;TD width="6.121654681592415%"&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can of course be achieved by using the function Sum (cost).&amp;nbsp;&lt;SPAN&gt;However when applying a selection to the raw material (e.g. raw material = aa), the user expects the result in the bottom table to remain the same. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To do this, I would apply sum( {&amp;lt;rm_pn=&amp;gt;} cost). Although it provides the expected outcome (e.g. 10 for A and 10 for B), it will still show C with a total_cost of 0.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The expected output is that the applied selection of raw material is disregarded in the calculation of total cost, but the table shown will only still show PN A and B.&lt;/P&gt;
&lt;P&gt;Would really appreciate very much if anyone can help!&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 15:41:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1900691#M74315</guid>
      <dc:creator>HarryLouis</dc:creator>
      <dc:date>2022-03-03T15:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1900701#M74317</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can try with P() expression, like :&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;[raw material]=, Part=P(Part)&amp;gt;} cost)&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 15:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1900701#M74317</guid>
      <dc:creator>Aurelien_Martinez</dc:creator>
      <dc:date>2022-03-03T15:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1900800#M74321</link>
      <description>&lt;P&gt;if you want to keep the table as is regardless of any selection, then write the following expression:&lt;BR /&gt;sum({1}Cost); this will make your table static with original result&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 17:59:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1900800#M74321</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2022-03-03T17:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901577#M74383</link>
      <description>&lt;P&gt;Thanks, but I had already tried this solution. The issue with this is that when a selection is applied to Raw material, the result set for the bottom table will still show all possible values.&lt;/P&gt;
&lt;P&gt;The goal when applying a filter to [Raw material] is that the calculation for total_cost remains the same, but only the [PN] in which the [Raw material] occurs should remain visible in the bottom table.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 15:19:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901577#M74383</guid>
      <dc:creator>HarryLouis</dc:creator>
      <dc:date>2022-03-06T15:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901652#M74385</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/114372"&gt;@HarryLouis&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;did you try the following:&lt;BR /&gt;Sum({1&amp;lt;Part=p(Part)&amp;gt;}Cost)&lt;BR /&gt;I selected here the aa raw material and I got in the table A -&amp;gt; 10 and B-&amp;gt;10&lt;BR /&gt;is this what you want to accomplish?&lt;BR /&gt;kindly advise&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 07:48:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901652#M74385</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2022-03-07T07:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901691#M74387</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Using the below suggestion and the proposal below, I have gotten close to the answer. My actual formula used is a bit more complex:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sum({&amp;lt;rm_pn=,PN=p(PN)&amp;gt;}
	aggr(
		if([costing_method]='Consumption / purchase cost', 
		Sum( {&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}total_rm_move_cost) * sum( {&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}relative_usage) / count( {&amp;lt;rm_pn=,PN=P(PN)&amp;gt;} Distinct [Repair Order ID]),
		sum({&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}fin_ratio) * sum({&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}coverage_price)),company,PN,rm_pn))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Applying a selection&amp;nbsp; to rm_pn still has an impact in the example that I am following. My bottom straight table also has a company dimension in it. Could this be the reason and should it be added?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 09:19:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901691#M74387</guid>
      <dc:creator>HarryLouis</dc:creator>
      <dc:date>2022-03-07T09:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901692#M74388</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think using the 1 does not seem to work (at least I think). Using the above suggestion and the proposal below, I have gotten close to the answer. My actual formula used is a bit more complex:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sum({&amp;lt;rm_pn=,PN=p(PN)&amp;gt;}
	aggr(
		if([costing_method]='Consumption / purchase cost', 
		Sum( {&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}total_rm_move_cost) * sum( {&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}relative_usage) / count( {&amp;lt;rm_pn=,PN=P(PN)&amp;gt;} Distinct [Repair Order ID]),
		sum({&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}fin_ratio) * sum({&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}coverage_price)),company,PN,rm_pn))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Applying a selection&amp;nbsp; to rm_pn still has an impact in the example that I am following using the formula above.&lt;/P&gt;
&lt;P&gt;My bottom straight table also has a company dimension in it. Could this be the reason and should it be added?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 09:21:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901692#M74388</guid>
      <dc:creator>HarryLouis</dc:creator>
      <dc:date>2022-03-07T09:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901796#M74396</link>
      <description>&lt;P&gt;the use of&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;PN=P(PN)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will have no effect because you are working in the default set of data ($)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 12:40:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901796#M74396</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2022-03-07T12:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901861#M74402</link>
      <description>&lt;P&gt;Hm you are right. I am getting to the expected result however when I'm applying&amp;nbsp; the below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sum( {&amp;lt;rm_pn=,PN=p(PN),costing_method={'Consumption / purchase cost'}&amp;gt;} aggr(Sum({&amp;lt;rm_pn=,PN=p(PN)&amp;gt;}total_rm_move_cost) * sum({&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}relative_usage) / count(total &amp;lt;PN&amp;gt;{&amp;lt;rm_pn=,PN=P(PN)&amp;gt;} Distinct [Repair Order ID]),company,PN,rm_pn))+
sum( {&amp;lt;rm_pn=,PN=p(PN),costing_method-={'Consumption / purchase cost'}&amp;gt;} aggr(sum({&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}fin_ratio) * sum({&amp;lt;rm_pn=,PN=P(PN)&amp;gt;}coverage_price),company,PN,rm_pn)))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Where the if statement is moved inside the set analysis.&lt;/P&gt;
&lt;P&gt;Removing the PN=p(PN) should I guess not change that result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 14:12:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901861#M74402</guid>
      <dc:creator>HarryLouis</dc:creator>
      <dc:date>2022-03-07T14:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901896#M74404</link>
      <description>&lt;P&gt;yes removing PN=P(PN) will not change the result&lt;BR /&gt;a question that I have: why are you using aggr function? what are the dimensions used in your table ?&lt;BR /&gt;if possible send me a sample QVF file with the expected result and I will try to solve it for you&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 14:58:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901896#M74404</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2022-03-07T14:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Ignore user selection of dimension in measure calculation, but apply it to the straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901925#M74407</link>
      <description>&lt;P&gt;Thanks. I am a bit short on time this week to produce a sample QVF - also I have gotten to the required result now.&lt;/P&gt;
&lt;P&gt;The reason why I applied the aggr( is because the total_rm_move_cost and repair order ID come from different tables with different hierarchies. Hence the Aggr() seemed to me the fastest and correct sollution for creating the summary by PN.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 16:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-Ignore-user-selection-of-dimension-in-measure/m-p/1901925#M74407</guid>
      <dc:creator>HarryLouis</dc:creator>
      <dc:date>2022-03-07T16:12:52Z</dc:date>
    </item>
  </channel>
</rss>

