Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qualify field name of concatenated tables

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' ?


1 Solution

Accepted Solutions
ramoncova06
Specialist III
Specialist III

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;


View solution in original post

4 Replies
ramoncova06
Specialist III
Specialist III

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;


danieloberbilli
Specialist II
Specialist II

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.

Anonymous
Not applicable
Author

Noted. Thanks.

Anonymous
Not applicable
Author

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.