<?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: For Qlik experts. How associations works in {1-$} set analysis? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/For-Qlik-experts-How-associations-works-in-1-set-analysis/m-p/1747697#M64103</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/7403"&gt;@barryharmsen&lt;/a&gt;&amp;nbsp;Hey Mates, what would you think regards Eugene's finding? Thanks you!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:46:09 GMT</pubDate>
    <dc:creator>marchoctober</dc:creator>
    <dc:date>2020-09-28T12:46:09Z</dc:date>
    <item>
      <title>For Qlik experts. How associations works in {1-$} set analysis?</title>
      <link>https://community.qlik.com/t5/App-Development/For-Qlik-experts-How-associations-works-in-1-set-analysis/m-p/1747607#M64102</link>
      <description>&lt;P&gt;Hi, community.&amp;nbsp; Recently i've tried to make set analysis tutorial video. As simple demonstration of it's power, i wanted to show example with {1-$} on simple model:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="evgeniystuchalk_0-1601279496542.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41296i64FC4F77DA2B977C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="evgeniystuchalk_0-1601279496542.png" alt="evgeniystuchalk_0-1601279496542.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Inline Data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;Sales: load * inline [&lt;BR /&gt;CityID,SalesSum,ProductID&lt;BR /&gt;1,100,1&lt;BR /&gt;1,150,2&lt;BR /&gt;1,200,3&lt;BR /&gt;1,170,4&lt;BR /&gt;1,50,5&lt;BR /&gt;1,180,6&lt;BR /&gt;2,90,1&lt;BR /&gt;2,40,3&lt;BR /&gt;2,60,5&lt;BR /&gt;3,80,1&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Cities: load * inline [&lt;BR /&gt;CityID, City&lt;BR /&gt;1, Moscow&lt;BR /&gt;2, St.Peterburg&lt;BR /&gt;3, Samara&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Products: load * inline [&lt;BR /&gt;ProductID, ProductName, CategoryID&lt;BR /&gt;1, P1,1&lt;BR /&gt;2, P2,1&lt;BR /&gt;3, P3,2&lt;BR /&gt;4, P4,2&lt;BR /&gt;5, P5,3&lt;BR /&gt;6, P6,3&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Categories: load * inline [&lt;BR /&gt;CategoryID, CategoryName&lt;BR /&gt;1, C1&lt;BR /&gt;2, C2&lt;BR /&gt;3, C3&lt;BR /&gt;];&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;In visual layer, i've created table that shows sum of sales by categories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="evgeniystuchalk_2-1601279670637.png" style="width: 697px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41298i0045C67C670563B4/image-dimensions/697x340?v=v2" width="697" height="340" role="button" title="evgeniystuchalk_2-1601279670637.png" alt="evgeniystuchalk_2-1601279670637.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When i'm selecting city, in second measure of table i expect to see in sum of sales of excluded cities by categories.&lt;/P&gt;&lt;P&gt;Sum of of excluded sales calculated correct, but it not associated with categories, if selected city have sales in this categories.&lt;/P&gt;&lt;P&gt;Selected City with 3 categories:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="evgeniystuchalk_3-1601279823268.png" style="width: 702px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41299iCBF0F03FC0ADC9BB/image-dimensions/702x372?v=v2" width="702" height="372" role="button" title="evgeniystuchalk_3-1601279823268.png" alt="evgeniystuchalk_3-1601279823268.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Selected City with 1 category:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="evgeniystuchalk_4-1601280520685.png" style="width: 700px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41300i500D489C11E43C92/image-dimensions/700x390?v=v2" width="700" height="390" role="button" title="evgeniystuchalk_4-1601280520685.png" alt="evgeniystuchalk_4-1601280520685.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, if we joined Sales, Products and Categories tables in script load, everything works as expected.&lt;/P&gt;&lt;P&gt;Joined Tables Code Inline:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;Sales: load * inline [&lt;BR /&gt;CityID,SalesSum,ProductID&lt;BR /&gt;1,100,1&lt;BR /&gt;1,150,2&lt;BR /&gt;1,200,3&lt;BR /&gt;1,170,4&lt;BR /&gt;1,50,5&lt;BR /&gt;1,180,6&lt;BR /&gt;2,90,1&lt;BR /&gt;2,40,3&lt;BR /&gt;2,60,5&lt;BR /&gt;3,80,1&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Products: left join load * inline [&lt;BR /&gt;ProductID, ProductName, CategoryID&lt;BR /&gt;1, P1,1&lt;BR /&gt;2, P2,1&lt;BR /&gt;3, P3,2&lt;BR /&gt;4, P4,2&lt;BR /&gt;5, P5,3&lt;BR /&gt;6, P6,3&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Categories: left join load * inline [&lt;BR /&gt;CategoryID, CategoryName&lt;BR /&gt;1, C1&lt;BR /&gt;2, C2&lt;BR /&gt;3, C3&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Cities: load * inline [&lt;BR /&gt;CityID, City&lt;BR /&gt;1, Moscow&lt;BR /&gt;2, St.Peterburg&lt;BR /&gt;3, Samara&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="evgeniystuchalk_6-1601280750292.png" style="width: 301px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41302i64BFE3977A4437BE/image-dimensions/301x279?v=v2" width="301" height="279" role="button" title="evgeniystuchalk_6-1601280750292.png" alt="evgeniystuchalk_6-1601280750292.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="evgeniystuchalk_5-1601280698908.png" style="width: 715px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41301i3ABFE82B39D03F63/image-dimensions/715x351?v=v2" width="715" height="351" role="button" title="evgeniystuchalk_5-1601280698908.png" alt="evgeniystuchalk_5-1601280698908.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while i'm writing this, some conclusions already generated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;1) Set Analysis works on level of data model tables, not on hypercube level. It means, in first case, we excluding all DATA MODEL records, that related to current selections, that means 3 out of 3 categories records, from Category Dictionary. And for {1-$} scenario, no categories left to display for this measure.&lt;/P&gt;&lt;P&gt;2) In second case, we also excluding records with 3 categories that related to selected city. But! Excluded sales records have their own category names, and it means we can see sum for excluded cities by category.&lt;/P&gt;&lt;P&gt;3) For analytics of excluded scenarios, more reliable use e() and p() functions.&lt;/P&gt;&lt;P&gt;Also, it will be nice to hear some commentaries and advices from experts &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;upd. 4) sum({1} Sales) - sum({$} Sales) also work with Categories in separate table, and allow to avoid missing data, if some of values in selected fields is null.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622"&gt;@hic&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6152"&gt;@Oleg_Troyansky&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:03:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/For-Qlik-experts-How-associations-works-in-1-set-analysis/m-p/1747607#M64102</guid>
      <dc:creator>evgeniystuchalk</dc:creator>
      <dc:date>2024-11-16T18:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: For Qlik experts. How associations works in {1-$} set analysis?</title>
      <link>https://community.qlik.com/t5/App-Development/For-Qlik-experts-How-associations-works-in-1-set-analysis/m-p/1747697#M64103</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/7403"&gt;@barryharmsen&lt;/a&gt;&amp;nbsp;Hey Mates, what would you think regards Eugene's finding? Thanks you!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:46:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/For-Qlik-experts-How-associations-works-in-1-set-analysis/m-p/1747697#M64103</guid>
      <dc:creator>marchoctober</dc:creator>
      <dc:date>2020-09-28T12:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: For Qlik experts. How associations works in {1-$} set analysis?</title>
      <link>https://community.qlik.com/t5/App-Development/For-Qlik-experts-How-associations-works-in-1-set-analysis/m-p/1747848#M64104</link>
      <description>&lt;P&gt;This is a very interesting observation! I've never thought of it this way, mostly because I never used {1-$}, other than giving it as an example of using Set Analysis Operators with Set Identifiers in my training classes.&lt;/P&gt;&lt;P&gt;However, once you see this behavior, it's not too hard to explain why does it happen.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the normalized data structure, the set of data that is associated with the Current Selections ($), includes all the associated Fact records, and all other Dimensional records that are associated with the current selection. So, when a single Store is selected, all associated Products and Categories are being included in the Set $. When we exclude the Set $ (current selections) from the Set 1 (all data), all these associated products and categories get excluded from the resulting Set. Hence, it looks like the Set Analysis "doesn't work".&lt;/P&gt;&lt;P&gt;In the de-normalized structure, when all Dimensions are joined into the Fact, each row of the Fact carries its own copy of the dimensional attributes, such as Product and Category. So, now the {1-$} produces the expected results, because all the transactions in the Fact table that survived the exclusion, have their own instances of Products and Categories that are stored in the same table. In this case, it looks like Set Analysis "worked correctly".&lt;/P&gt;&lt;P&gt;In reality, Set Analysis worked the same way in both cases, however the difference in the data structure caused completely different results.&lt;/P&gt;&lt;P&gt;And of course, I completely agree with your assessment that it's always better to use functions P() and E() to exclude particular selected Dimensional values from a calculation.&lt;/P&gt;&lt;P&gt;Using the opportunity, let me invite all interested developers to the on-line version of our Masters Summit for Qlik 2020. We called it "Masters Summit @ Home". I'm opening on November 18th with my popular session on Set Analysis and Advanced Aggregation. Visit &lt;A href="https://MastersSummit.com" target="_blank" rel="noopener"&gt;MastersSummit.com&lt;/A&gt; for details.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:02:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/For-Qlik-experts-How-associations-works-in-1-set-analysis/m-p/1747848#M64104</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2020-09-28T20:02:34Z</dc:date>
    </item>
  </channel>
</rss>

