sql – I’d like to ask about Lookup being turned into a fact table


. I’m using Visual Studio 2022 and have used Lookup to make a fact table, but when I run it, the data doesn’t come up as shown in the picture.

enter image description here

The information will be something like this.

DimCustomer
Customerkey,CusCodeAltrnateKey,CustName
1,DAA-004,บจก.เอ
2,DAL-010,บจก.เอแลน ดี
3,DBD-006,หจก.บิลดิ้ง
4,DBK-001,บจก.บางกอก

DimDate
Datekey,FullDateAlternateKey,…
20050101,2005-01-01,…
20050102,2005-01-02,…
20050103,2005-01-03,…

DimProduct
ProductKey,ItemCodeAlternateKey,ItemCatagory,…
1,FB204CUXXX02,…
2,FB204CUXXX03,…
3,FB303XXXXX02,…

DimSection
SectionKey,MacCodeAlternaKey,SectionID,…
1,ANN001-1/1,AN,…
2,ANN1-10/1,AN,…

115,CGM001,CG,…

Stg_vw_Erp_FactProduction
DocNo,MacNo,ItemCodeCat,MachineCode,CustomerID,ItemCode,WIPINPut,OutPutSUM,TimeIm,PrintTime,
W2400664,DRA019,FBD4000XXX035,DRA019,DSK-021,FBD4000XXX035,279,279,2024-03-20 19:35:32,2024-03-20 20:56:43,…
W2400664,CUT002,FBD4000XXX035,CUT002,DSK-021,FBD4000XXX035,275.6,275.6,2024-04-09 18:10:38,2024-04-10 22:36:00,…
W2400664,ANN005-4/1,FBD4000XXX035,ANN005-4/1,DSK-021,FBD4000XXX035,79.2,79.2,2024-03-25 06:31:17,2024-03-25 21:07:27,…
W2400327,PAC001,FTY309LXXX016,PAC001,EPT-001-1,FTY309LXXX016,5,5,…

And is it caused by Lookup not finding it? But when I try to adjust the Error output to Ignore failure, it can run, but in the Fact table, no data comes in at all. Thank you.

-Stg_vw_Erp_FactProduction is Staging created by pulling information from many places. Let’s create a table in that database. The picture below is what was used to make Stg_view.
enter image description here

There will be 4 tables of information as follows that are joined together to form vw_Erp_Fact. Before putting it in Lookup at Data Warehouse, it is

1. vMfginmachine

enter image description here

2. vReport
enter image description here

3. vProduct
enter image description here

4.vDashboard
enter image description here

About this time, thank you very much. Is there anyone who can recommend some guidelines? Thank you very much.

The data used for staging is extracted from the view table and then retrieved.

I’d like to know why I can’t lookup in this data and how to fix it.

Leave a Reply

Your email address will not be published. Required fields are marked *