Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
amijit_hazarika
New Contributor III

Issue with Datamodel

Hi Qlik Enthusiast,

I am building a datamodel and getting stuck with bringing the right data and removing synthetic keys.

I have 2 files(File A and File B) and I have created facts and dimensions out of these 2 files.

Fact has Emp Id, Enitity Id, Revenue etc and Dim has Entity Name, Geography, Function etc.

When I join these with the help of Emp Id, I don't get correct output for Entity Name.

When I join with Entity Id then I get correct data for Entity Name but not the right Employee Id gets picked up.

For testing, I joined with Emp ID and Entity ID, I am getting the right output but this leads to synthetic table.

Solution or any advice would be highly appreciated.

Thanks in Advance.

1 Solution

Accepted Solutions
YoussefBelloum
Esteemed Contributor

Re: Issue with Datamodel

Hi,

on both tables, you should create a composite key, like this:

Autonumber([Emp ID]&[Entity ID]) as Key


and remove [Emp ID] and [Entity ID] fields from your tables


PS: you can create composite key without functions like Autonumber(), like this: [Emp ID]&[Entity ID] as Key

it is a matter of optimization


7 Replies
isingh30
Valued Contributor

Re: Issue with Datamodel

Can you share your data or sample application?

Thanks

YoussefBelloum
Esteemed Contributor

Re: Issue with Datamodel

Hi,

on both tables, you should create a composite key, like this:

Autonumber([Emp ID]&[Entity ID]) as Key


and remove [Emp ID] and [Entity ID] fields from your tables


PS: you can create composite key without functions like Autonumber(), like this: [Emp ID]&[Entity ID] as Key

it is a matter of optimization


amijit_hazarika
New Contributor III

Re: Issue with Datamodel

Hi,

Which one would you suggest? Autonumber or Autonumberhash128?

Thanks

YoussefBelloum
Esteemed Contributor

Re: Issue with Datamodel

it depends on the amount of data you load.. and on other things that I ignore.. on a small/medium set of data I put whatever comes in mind. when it comes to heavy datasets, I automatically do some benchmarking

uroboros
Contributor

Re: Issue with Datamodel

Hi @

amijit_hazarika
New Contributor III

Re: Issue with Datamodel

Thanks Youssef!

This worked.

Cheers (y)

YoussefBelloum
Esteemed Contributor

Re: Issue with Datamodel

you're welcome, good luck