Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sushil353
Master II
Master II

how do i concat multiple fact table with same field with a flag?

Hi All,

I have two fact table

table one:

location_code

area_code

time_id

defects

processed

table two;

location_code

area_code

time_id

defects

processed

failure

and dimensions are time,location and area

how would i concat them into a single table such that after concating i am able to know which field is from which table....(means how do i add flag)

Please help me out...

Thanks

4 Replies
gandalfgray
Specialist II
Specialist II

Hi Sushil

NewTable:

Load 'Table one' As SourceTable,

     location_code,

     area_code,

     time_id,

     defects,

     processed

Resident [table one];

Concatenate (NewTable)

Load 'Table two' As SourceTable,

     location_code,

     area_code,

     time_id,

     defects,

     processed,

     failure

Resident [table two];

Drop Tables [table one], [table two];

The field SourceTable shows where the data came from

hth/gg

Not applicable

So you basically want to a full list of 'location_code' from both tables for example but still see which it came from originally?

I think you should just be able to add an identifer to each table before you concat them

so

table one:

load

location_code,

area_code,

time_id,

defects,

processed,

'table one' as Table_Flag

same for table two and then concat

hope that helps

Joe

edit: in the time of writing that GG beat me to it!

sushil353
Master II
Master II
Author

Hi GG..

Thanks

Is it required to keep table name in single quotes

as my table name is PRD_YIELD_OP_TYPE_SUMMARY

so i am doing like

'PRD_YIELD_OP_TYPE_SUMMARY' as sourcePrdYield

gandalfgray
Specialist II
Specialist II

Yes the quotes are required,

otherwise QV will look for a field named PRD_YIELD_OP_TYPE_SUMMARY

in your source.

/gg