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: 
Not applicable

Joining calendar to Fact table

Hi Everyone

I am building a model and struggling with linking the dates data to my fact table.

I have used Year(DateField)*100+ Month(DateField) to join my calendar and fact tables but the data doesn't seem to have a relationship.

Please assist. I have attached my app and data files

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

You have concatenated the facts with Customers and with Items. I have loaded these in three different tables. Also, you had too many keys, so I have removed the redundant ones. Finally, I changed the definition of YearMonth.

See attachment.

HIC

View solution in original post

4 Replies
jduenyas
Specialist
Specialist

Set you YearMonth as

MakeDate(Year(FIN_YEAR_ID),Month(FIN_YEAR_ID),Day(FIN_YEAR_ID))

Do the same with other data from other tables so that the date format on all date values is the same (MM/DD/YYYY without Hours and Minutes -- if that is your requirement)

hic
Former Employee
Former Employee

You define your key incorrectly...

You should probably use

     FIN_YEAR_ID*100+Month(FIN_YEAR_ID) as YearMonth,

instead of

     Year(FIN_YEAR_ID)*100+Month(FIN_YEAR_ID) as YearMonth,

Image1.png

Not applicable
Author

Hi Henric

I have changed the field expression as per your suggestion and the data still doesn't link.

Can you perhaps upload the app if you can get it right on your side?

2015-03-17_22-50-58.png

hic
Former Employee
Former Employee

You have concatenated the facts with Customers and with Items. I have loaded these in three different tables. Also, you had too many keys, so I have removed the redundant ones. Finally, I changed the definition of YearMonth.

See attachment.

HIC