Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

Help with creating fact table in star schema

Hello.

I've identified my facts(fact_table)  and the dimensions (Table_dim_[no]).

My fact table consists of the metrics and the grain of table_dim_[no]_id which I have counted as rowno() for each dimension table.

My fact table though is made of many tables  with "CONCATENATE" that by this gives me a lot of null values in the fields which i believe shouldn't happen.

How to fix this?

3 Replies
Lisa_P
Employee
Employee

can you give a sample of your data and script ?

ioannagr
Creator III
Creator III
Author

Hi @Lisa_P , yes, here is my script:

 

[Table 1]:

LOAD
RowNo() as table1_dim_id,
"department ID"

"Department name"

from [$(vPathQVD)Table1.qvd]
(qvd)
where "Department name"='This';

 

[Table 2]:

LOAD
RowNo() as table2_dim_id,
"client ID",
"Type"


FROM [$(vPathQVD)Table2.qvd]
(qvd)
where len("Client ID")<>0 and "Type"='That';

[Facts]

LOAD

RowNo() as fact_id,
RowNo() as table1_dim_id,

"Quantity" 


from [$(vPath)Table1.qvd]
(qvd);

Concatenate

LOAD RowNo() as table2_dim_id,
sum
FROM [$(vPathQVD)Table2.qvd]
(qvd);

 

 

marcus_sommer

Asynchron fields (fields which aren't available within all sources) from concatenated loadings will contain NULL's and of course also NULL's if there are NULL's within the source itself. Usually that's not a problem and worked mostly very well and therefore there is no special need of "fixing" it because nothing is wrong.

- Marcus