<?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: Linking fact table to dimension table 2 ways in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535548#M108537</link>
    <description>&lt;P&gt;Thank you, but I’m not following how this helps - Sales will still need to be linked directly to Product via ProductID, I think? And this link table will also be linked to Product via the category levels, so won’t I still have circular references?&lt;/P&gt;</description>
    <pubDate>Thu, 06 Nov 2025 23:21:05 GMT</pubDate>
    <dc:creator>MartinW1</dc:creator>
    <dc:date>2025-11-06T23:21:05Z</dc:date>
    <item>
      <title>Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535537#M108534</link>
      <description>&lt;P&gt;I am relatively new to the Qlik universe and am setting a data model up in Qlik Sense, but really struggling to get it linking correctly, without circular references.&lt;/P&gt;&lt;P&gt;The tables/fields in question are:&lt;/P&gt;&lt;P&gt;Sales - ProductID, SalesSource, CustomerID, SalesValue&lt;/P&gt;&lt;P&gt;Product - ProductID, CategoryLevel1, CategoryLevel2&lt;/P&gt;&lt;P&gt;Targets -&amp;nbsp;SalesSource, CustomerID, CategoryLevel1, CategoryLevel2, SalesTarget&lt;/P&gt;&lt;P&gt;The problem is with linking both Sales and Targets to Product via different fields when the 2 are linked themselves (or in a concatenated fact table, as I have it at the moment). I've tried various versions of link tables and synthetic keys, but can't get it working correctly.&lt;/P&gt;&lt;P&gt;Any suggestions/pointers please?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 17:58:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535537#M108534</guid>
      <dc:creator>MartinW1</dc:creator>
      <dc:date>2025-11-06T17:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535546#M108536</link>
      <description>&lt;P&gt;You can use link table&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just search on link table implementation&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Load distinct combinations of the linking fields from both fact tables&lt;/P&gt;&lt;P&gt;LinkTable:&lt;/P&gt;&lt;P&gt;LOAD DISTINCT&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SalesSource,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CustomerID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CategoryLevel1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CategoryLevel2&lt;/P&gt;&lt;P&gt;RESIDENT Targets;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CONCATENATE (LinkTable)&lt;/P&gt;&lt;P&gt;LOAD DISTINCT&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SalesSource,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CustomerID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CategoryLevel1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CategoryLevel2&lt;/P&gt;&lt;P&gt;RESIDENT Sales&lt;/P&gt;&lt;P&gt;INNER JOIN (Sales)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ProductID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CategoryLevel1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CategoryLevel2&lt;/P&gt;&lt;P&gt;RESIDENT Product;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 21:01:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535546#M108536</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2025-11-06T21:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535548#M108537</link>
      <description>&lt;P&gt;Thank you, but I’m not following how this helps - Sales will still need to be linked directly to Product via ProductID, I think? And this link table will also be linked to Product via the category levels, so won’t I still have circular references?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 23:21:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535548#M108537</guid>
      <dc:creator>MartinW1</dc:creator>
      <dc:date>2025-11-06T23:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535561#M108539</link>
      <description>&lt;P&gt;Hi check out this, Before applying the ApplyMap function, ensure that the first two mapping tables contain &lt;STRONG&gt;distinct records&lt;/STRONG&gt; — that is, no duplicate keys exist in either mapping table.&lt;/P&gt;&lt;LI-CODE lang="php"&gt;ProductMap:
MAPPING LOAD
    ProductID,
    CategoryLevel1,
    CategoryLevel2
FROM [Product.qvd] (qvd);

TargetMap:
MAPPING LOAD
    SalesSource &amp;amp; '|' &amp;amp; CustomerID &amp;amp; '|' &amp;amp; CategoryLevel1 &amp;amp; '|' &amp;amp; CategoryLevel2 AS TargetKey,
    SalesTarget
FROM [Targets.qvd] (qvd);

Sales:
LOAD *,
    ApplyMap(
        'TargetMap',
        SalesSource &amp;amp; '|' &amp;amp; CustomerID &amp;amp; '|' &amp;amp; CategoryLevel1 &amp;amp; '|' &amp;amp; CategoryLevel2,
        0
    ) AS SalesTarget;
LOAD
    ProductID,
    SalesSource,
    CustomerID,
    SalesValue,
    ApplyMap('ProductMap', ProductID, 'Unknown') AS CategoryLevel1,
    ApplyMap('ProductMap', ProductID, 'Unknown') AS CategoryLevel2
FROM [Sales.qvd] (qvd);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 06:31:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535561#M108539</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2025-11-07T06:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535569#M108540</link>
      <description>&lt;P&gt;A question to ask yourself or your stakeholder: what target should be displayed if you selects a single product that share categories with other products?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should it display the total target value for the product category and source combination? Or should you display nothing, because you don't have a targer on that detail level?&lt;/P&gt;&lt;P&gt;For the later I would consider to concatenate the sales and target tables into the same fact table.&lt;/P&gt;&lt;P&gt;For the first I would consider joining in the product categories on to the sales table, and then use the combination of the two categories and SalesSource be the associated link between the sales and target tables. (Here I assume that the ProductID is a unique key for the product table to avoid the join causing a fan out duplication)&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 07:35:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535569#M108540</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2025-11-07T07:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535626#M108543</link>
      <description>&lt;P&gt;Yes, when any dimension is selected that doesn't have targets, 0 should be displayed. I'm handling that in the target measures atm. And I already have a version of the model with sales and targets in one fact table, but I'm struggling to get the link(s) to products working in either version&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 13:13:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535626#M108543</guid>
      <dc:creator>MartinW1</dc:creator>
      <dc:date>2025-11-07T13:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535627#M108544</link>
      <description>&lt;P&gt;I'll give this a go, but looking at it quickly, won't this only show a sales target for lines where there are sales? I will need it to show 0 sales but with a target value in that instance.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 12:47:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535627#M108544</guid>
      <dc:creator>MartinW1</dc:creator>
      <dc:date>2025-11-07T12:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535653#M108546</link>
      <description>&lt;P&gt;As an update to this, I found a solution using a combination of the suggestions above.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[Product]:
LOAD
	ProductID,
	CategoryLevel1,
    CategoryLevel2;

Concatenate([Product])
LOAD DISTINCT
	'TargetDummy' AS ProductID,
	CategoryLevel1,
	CategoryLevel2;
	

[ProductMapL1]:
MAPPING LOAD
    ProductID,
    CategoryLevel1
RESIDENT Product;


[ProductMapL2]:
MAPPING LOAD
    ProductID,
	CategoryLevel2
RESIDENT Product;


[Sales]:
LOAD
	ProductID,
    SalesSource,
    CustomerID,
    ApplyMap('ProductMapL1', ProductID, 'Unknown') AS CategoryLevel1,
    ApplyMap('ProductMapL2', ProductID, 'Unknown') AS CategoryLevel2,
	Sales;


[Targets]:
LOAD
	'TargetDummy' AS ProductID,
	SalesSource,
    CustomerID,
    CategoryLevel1,
	CategoryLevel2,
	Target;
	&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;You can then create a key or link table (or just let Qlik create a synthetic key) with ProductID, CategoryLevel1 &amp;amp; CategoryLevel2.&amp;nbsp;It's probably not the "best" way round it, but it's working&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 17:14:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535653#M108546</guid>
      <dc:creator>MartinW1</dc:creator>
      <dc:date>2025-11-07T17:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535744#M108558</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;Highlighted different colors for table association&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sales:&lt;/STRONG&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;&lt;FONT color="#FFCC00"&gt;&lt;STRONG&gt;ProductID, // Key to Product&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#00FF00"&gt;&lt;STRONG&gt;SalesSource&amp;amp;CustomerID as Key, // Key to Targets (part of composite key)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;SalesValue&lt;BR /&gt;FROM Sales;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Product:&lt;/STRONG&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;&lt;FONT color="#FFCC00"&gt;&lt;STRONG&gt;ProductID, // Key to Sales&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;CategoryLevel1,&lt;BR /&gt;CategoryLevel2&lt;BR /&gt;FROM Products;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Targets:&lt;/STRONG&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;&lt;FONT color="#00FF00"&gt;&lt;STRONG&gt;SalesSource&amp;amp;CustomerID as Key,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;CategoryLevel1,&lt;BR /&gt;CategoryLevel2,&lt;BR /&gt;SalesTarget&lt;BR /&gt;FROM Target;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2025 09:36:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535744#M108558</guid>
      <dc:creator>Nagaraju_KCS</dc:creator>
      <dc:date>2025-11-10T09:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535749#M108560</link>
      <description>&lt;P&gt;This is how I had it to begin with. Using this method there is either:&lt;/P&gt;&lt;P&gt;- no link between Targets and Product, so targets do not show against Category levels 1 or 2&lt;/P&gt;&lt;P&gt;- a link to Product via the 2 Category levels, creating a circular reference&lt;/P&gt;&lt;P&gt;This was my original issue I was trying to solve.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2025 09:50:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535749#M108560</guid>
      <dc:creator>MartinW1</dc:creator>
      <dc:date>2025-11-10T09:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Linking fact table to dimension table 2 ways</title>
      <link>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535752#M108563</link>
      <description>&lt;P&gt;yeah, got it - you can try this as well&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;STRONG&gt;Sales:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;LOAD&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ProductID,&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SalesSource,&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CustomerID,&lt;/DIV&gt;&lt;DIV&gt;SalesValue&lt;/DIV&gt;&lt;DIV&gt;from Sales;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;left join&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Product:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;LOAD&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ProductID,&lt;/DIV&gt;&lt;DIV&gt;CategoryLevel1,&lt;/DIV&gt;&lt;DIV&gt;CategoryLevel2&lt;/DIV&gt;&lt;DIV&gt;From Product;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Sales_Product:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;Load ProductID,&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SalesSource,&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CustomerID,&lt;/DIV&gt;&lt;DIV&gt;CategoryLevel1,&lt;/DIV&gt;&lt;DIV&gt;CategoryLevel2,&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SalesValue as Sales,&lt;/DIV&gt;&lt;DIV&gt;'Value' as Flag&lt;/DIV&gt;&lt;DIV&gt;Resident Sales;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Drop table Sales;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Concatenate&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Targets:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;LOAD 'Dummy' as ProductID,&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SalesSource,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CustomerID,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CategoryLevel1,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CategoryLevel2,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SalesTarget as Sales,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Target' as Flag&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;From Target;&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Nov 2025 10:20:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Linking-fact-table-to-dimension-table-2-ways/m-p/2535752#M108563</guid>
      <dc:creator>Nagaraju_KCS</dc:creator>
      <dc:date>2025-11-10T10:20:07Z</dc:date>
    </item>
  </channel>
</rss>

