Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cpalbrecht
Creator
Creator

Qlik Sense unique dimension key

Hi All,

in Qlik View there are "Perfect Keys". Is there a same concept in Qlik Sense? Should I also use "perfect keys" e.g. as dimension keys? From performance point of view, is there any difference if you have unique 1:1 or 1:n dimension keys?

I ask because there is the following problem:

FactTable:

Event TimestampStatusDimKey
2016-01-01 01:00:00ax
2016-01-01 01:00:01ay
2016-01-01 01:00:02bx
2016-01-01 01:00:03ax
2016-01-01 01:00:04by
2016-01-01 01:00:05cz


StatusDimTable:


StatusDimKeyStatusIdStatusValue
axaax1
axaax2
axaax3
ayaay1
bxbbx1
bxbbx2
bybby1
bybby2
czccz1
czccz2
czccz3

The problem here is, each StatusKey can have multiple StatusValues for a specific StatusId. Is it a problem to have not unique dimension keys (StatusDimKey)?

Or should I do the following with the fact table?

NewFactTable1:


Event TimestampStatusDimKey
2016-01-01 01:00:00ax1
2016-01-01 01:00:00ax2
2016-01-01 01:00:00ax3
2016-01-01 01:00:01ay1
2016-01-01 01:00:02bx1
2016-01-01 01:00:02bx2
2016-01-01 01:00:03ax1
2016-01-01 01:00:03ax2
2016-01-01 01:00:03ax3
2016-01-01 01:00:04by1
2016-01-01 01:00:04by2
2016-01-01 01:00:05cz1
2016-01-01 01:00:05cz2
2016-01-01 01:00:05cz3

That causes a lot more rows in the fact table.

14 Replies
YoussefBelloum
Champion
Champion

I mean by that, that when you have fields on your dimenion table that are more detailed than your joining key field (between this dim and the fact), you will not be able to use them to analyze your Measures

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'll second Christoph's question. I don't see any problem with the original model. In fact I think it's a good one to model the one-StatusDimKey  to many-StatusValue.  You can associate any one StatusValue to the Fact or list all the associated StatusValue with concat(StatusValue, ',')

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

YoussefBelloum
Champion
Champion

EDITED

rwunderlich Thank you Rob for your time,

would you be able to show us your approach here with some code linking fact table to dim table ?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Nothing special to do here. According to the tables posted by OP, the two tables are linked by StatusDimKey.

-Rob

YoussefBelloum
Champion
Champion

Thats why I was asking.. I thought maybe Im missing something important here.

So the only thing wrong I said here is when I said that " he can't use the dimensions fields that are more detailed than the key field to analyze his measures".. It is because I usually use 1:n relations on the dimensions table starting from the key.