Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
MartinW1
Contributor II
Contributor II

Linking fact table to dimension table 2 ways

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.

The tables/fields in question are:

Sales - ProductID, SalesSource, CustomerID, SalesValue

Product - ProductID, CategoryLevel1, CategoryLevel2

Targets - SalesSource, CustomerID, CategoryLevel1, CategoryLevel2, SalesTarget

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.

Any suggestions/pointers please?

Labels (2)
10 Replies
Nagaraju_KCS
Specialist III
Specialist III

yeah, got it - you can try this as well 

Sales:
LOAD 
ProductID, 
SalesSource, 
CustomerID,
SalesValue
from Sales;
 
left join 
Product:
LOAD 
ProductID,
CategoryLevel1,
CategoryLevel2
From Product;
 
Sales_Product:
Load ProductID, 
SalesSource, 
CustomerID,
CategoryLevel1,
CategoryLevel2, 
SalesValue as Sales,
'Value' as Flag
Resident Sales;
 
Drop table Sales;
 
Concatenate
Targets:
LOAD 'Dummy' as ProductID,
SalesSource, 
CustomerID,
CategoryLevel1,
CategoryLevel2,
SalesTarget as Sales,
'Target' as Flag
From Target;