Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenate and Qualify problem

Good day,

I have a problem with the "QUALIFY *" statement when I'm using the keyword "concatenate".

Let's say I have the following table :

[CODE]

QUALIFY *;
Table1:
LOAD * INLINE [
Field A
];
UNQUALIFY *;

[/CODE]

I also have another table that have contents :

[CODE]

UNQUALIFY *;
Tabletmp:
LOAD * INLINE [
Field A tmp
Abc
Def
Ghi
];

[/CODE]

Next, I want to add to my "Table1" the data of my Tabletmp :

[CODE]

QUALIFY *;
CONCATENATE (Table1) LOAD [Field A tmp] AS [Field A]
RESIDENT Tabletmp;

DROP TABLE Tabletmp;

[/CODE]

I assumed this would work, prefixing each filed with "Table1".

But unfortunatly, I don"t have the fields I wanted : my Table1 is composed of "Table1.Field A" that is always empty, and a field "Tabletmp-1.Field A" that contains the values.

Why the "QUALIFY" takes the source table name instead of the destination table name ?

(I'm using QlikView 9 SR 6)

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens


nmartin wrote:Why the "QUALIFY" takes the source table name instead of the destination table name ?


That's the intented use for Qualify, and so is documented, preceding the loading fields with the name of the table those fields belong. For this particular case, you can workaround that, unqualifying the temp table:

QUALIFY *;Table1:LOAD * INLINE [Field A];UNQUALIFY *; Tabletmp:LOAD * INLINE [Field A tmpAbcDefGhi]; CONCATENATE (Table1) LOAD [Field A tmp] AS [Table1.Field A]RESIDENT Tabletmp; DROP TABLE Tabletmp;


Hope this helps.

View solution in original post

4 Replies
Miguel_Angel_Baeyens


nmartin wrote:Why the "QUALIFY" takes the source table name instead of the destination table name ?


That's the intented use for Qualify, and so is documented, preceding the loading fields with the name of the table those fields belong. For this particular case, you can workaround that, unqualifying the temp table:

QUALIFY *;Table1:LOAD * INLINE [Field A];UNQUALIFY *; Tabletmp:LOAD * INLINE [Field A tmpAbcDefGhi]; CONCATENATE (Table1) LOAD [Field A tmp] AS [Table1.Field A]RESIDENT Tabletmp; DROP TABLE Tabletmp;


Hope this helps.

Not applicable
Author

This is the workaround I already use.

Too bad I have in my real application more than 1 field 😉

I have the documentation in French, and it says something like that "the new name will be tablename.fieldname. fieldname is the label of the current table or, if there is no label, the name that appears after the from".

Le nouveau nom suivra le modèle nomdetable.nomdechamp. Nomdetable correspond à
l'étiquette de la table active
ou, si aucune étiquette n'existe, au nom apparaissant après from dans les instructions load et select.


I though that "concatenate (table1)" would specify that "table1" is the current table 😞

Miguel_Angel_Baeyens


nmartin wrote:I though that "concatenate (table1)" would specify that "table1" is the current table 😞


It says likewise in Spanish (obviously). Although you are concatenating, the source table in your case is the RESIDENT table, since there are still two tables. After the concatenation (say, another resident load), the first table name will be the qualifier. But if that's the problem, why don't you rename the fields you want to use for concatenation? You can specify which fields have or have not to be qualified:

QUALIFY *;UNQUALIFY CustomerID, OrderID;


This shold even save you some time.

Hope that helps

Not applicable
Author

I'll manage on my own with the syntax... (not hard, but long)

But thanks to you, now I understand better how "QUALIFY" works.