Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Insert calculated field from resident table

I need to add the GOVERNING_GROUP field from my fact table called EHRG_TICKET into the  RPT_EHRG_BUILD_HOURS table. 

 

RPT_EHRG_BUILD_HOURS:
LOAD "bug_id" as DEFECT_ID,
"build_group",
monthstart(month) as month,
"pte_design",
"pte_build",
analyst,
"actual_design",
"est_np_build",
"act_np_build",
"est_prod_build",
"act_prod_build",
"ETL_DATE";
SQL SELECT *
FROM "IT_DW".dbo."RPT_EHRG_BUILD_HOURS";

GOVDATA:

LOAD DEFECT_ID,GOVERNING_GROUP
Resident EHRG_TICKET;

Inner Join (GOVDATA) Load GOVERNING_GROUP Resident RPT_EHRG_BUILD_HOURS;

drop table GOVDATA;

Labels (3)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

why do you want to add it to  the table ?as the 2 tables are linked you get GOVERNING_GROUP in front end anyway

in any case

during the join you dont have the key and you seem to have done it other way round. you code tries to update GOVDATA table and then drops it

going by your description where you say you want to add governing_group in to   RPT_EHRG_BUILD_HOUR table try something like below (inner join or left depends on the data)

Inner Join (RPT_EHRG_BUILD_HOURS) 

LOAD DEFECT_ID,GOVERNING_GROUP
Resident EHRG_TICKET;

let me know if i missed something

View solution in original post

4 Replies
dplr-rn
Partner - Master III
Partner - Master III

why do you want to add it to  the table ?as the 2 tables are linked you get GOVERNING_GROUP in front end anyway

in any case

during the join you dont have the key and you seem to have done it other way round. you code tries to update GOVDATA table and then drops it

going by your description where you say you want to add governing_group in to   RPT_EHRG_BUILD_HOUR table try something like below (inner join or left depends on the data)

Inner Join (RPT_EHRG_BUILD_HOURS) 

LOAD DEFECT_ID,GOVERNING_GROUP
Resident EHRG_TICKET;

let me know if i missed something

cbaqir
Specialist II
Specialist II
Author

I need to join the build hours table to another table with a concatenated key of month and Governing Group. 2020-10-15_16-11-16.jpg

cbaqir
Specialist II
Specialist II
Author

I am still getting a synthetic table.

2020-10-16_13-17-11.jpg

How would I then be able to create my key [Governing Group]&'-'&monthstart(month) as %GG_MONTH_KEY?

dplr-rn
Partner - Master III
Partner - Master III

i dont understand you need well enough to answer fully. (initial question didnt have anything on month)

 

but if you are adding  GOVERNING_GROUP to RPT_EHRG_BUILD_HOURS purely to join another table. 

you could delete the column from RPT_EHRG_BUILD_HOURS after you have done the join (i am assuming you have done so in picture the last post)

that should address the synthetic key i see in the picture (last one)