Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vaisgaard
Contributor III
Contributor III

Qlik Sense: Fetching data into fact table with filtered queries

Hi,

I want to be able to build a fact table in Qlik Sense, where I collect data from different data sources. When fetching data from the data sources I want to limit the queries to the base structure of my fact table to limit data to a minimum.

Example:

Base structure of fact table

user_idname
scjoScarlett Johansen
brpiBrad Pitt
tohaTom Hanks
anjoAngelina Jolie
madaMatt Damon

Sales table

user_idsales
scjo553
toha625
anjo125
brpi485

Budget table

user_idbudget
scjo500
brpi700
toha300
anjo

150

mada250

Sales meetings table

user_idmeeting_date
brpi2017-01-20
brpi2017-02-03
toha2017-03-10
anjo2017-03-22

The source tables will in reality contain a lot of data on other user_ids, so I need to filter on only the employees in my fact table.

How to do this?

Hope you guys can help.

Best regards
Michael Vaisgaard
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

For Example try below

FACT

LOAD * inline [

user_idname
anjoAngelina Jolie
brpiBrad Pitt
madaMatt Damon
scjoScarlett Johansen
tohaTom Hanks

];

INNER KEEP



table2

load * inline [

user_id
anjo
brpi
mada
scjo
toha

];

Drop table table2;

after this you will only have FACT data for ID's specified in table2

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

I think KEEP is what will help you in this scenario

Look at the example on using keep here

Understanding Join, Keep and Concatenate

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

For Example try below

FACT

LOAD * inline [

user_idname
anjoAngelina Jolie
brpiBrad Pitt
madaMatt Damon
scjoScarlett Johansen
tohaTom Hanks

];

INNER KEEP



table2

load * inline [

user_id
anjo
brpi
mada
scjo
toha

];

Drop table table2;

after this you will only have FACT data for ID's specified in table2

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.