Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to concatenate 2 similar tables and qualify the name of the combined table
I tired this
QUALIFY *;
OpenClose:
LOAD //-- Load all tickets and record open date
'Open' as [Record Type],
[Created Date] as [Date]
Resident Ticket
Concatenate
LOAD //- Load all closed tickets and use closed date
'Closed' as [Record Type],
[Closed Date] as [Date],
Resident Ticket where Closed=1;
but this qualifed the fields from the 1st table with 'OpenClose' but the fields in the 2nd is qualified with 'Ticket-1'.
How can I make the fields from both tables to have the same prefix, i.e. 'OpenClose' ?
why would you want to use qualify for this ?
qualify can become a nightmare if not used correctly
anyways you can do the concatenation first and then apply the qualify
Temp:
LOAD //-- Load all tickets and record open date
'Open' as [Record Type],
[Created Date] as [Date]
Resident Ticket
Concatenate
LOAD //- Load all closed tickets and use closed date
'Closed' as [Record Type],
[Closed Date] as [Date],
Resident Ticket where Closed=1;
QUALIFY *;
OpenClose
load
*
resident Temp;
unqualify*;
drop table Temp;
why would you want to use qualify for this ?
qualify can become a nightmare if not used correctly
anyways you can do the concatenation first and then apply the qualify
Temp:
LOAD //-- Load all tickets and record open date
'Open' as [Record Type],
[Created Date] as [Date]
Resident Ticket
Concatenate
LOAD //- Load all closed tickets and use closed date
'Closed' as [Record Type],
[Closed Date] as [Date],
Resident Ticket where Closed=1;
QUALIFY *;
OpenClose
load
*
resident Temp;
unqualify*;
drop table Temp;
I agree with Ramon - I would not even consider using Qualify followed by data modeling like joining or concatenating...its indeed a nightmare if later you try to change / add script or simply try to search for a mistake in your modelling.
Noted. Thanks.
Thanks. I was wondering if there is another way to do this as I was afraid creating a temp table with the same field names would cause linkage to the resident table and affect performance. Thus I was trying to rename the fields when the new table is created.