Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
alexeyrv
Contributor II
Contributor II

How to use own prefix to fields with qualify ?

Hi all.

Questions is - How to manually define the prefix to loading fields.
Goal - prefix should be readable.

Defalult manner - prefix is equal to table name.

Problem - Sometimes a table name from source unreadable like "Sheet123" or "DB12s5eb011-a2".
This kind of naming is very unusable even for a developer.

Is it possible to redefine manually field prefix for all fields in a table with own prefix string instead of table name? Something the qulify example in the Qlik help below but with declaration my own prefix.

Maybe  "LOAD A,B from x.csv where $prefix='xregion';"

"Qualify B;
LOAD A,B from x.csv;
LOAD A,B from y.csv;

The two tables x.csv and y.csv are associated only through A. Three fields will result: A, x.B, y.B.In the same way I want to ignore some fields that should be key feilds like ID or Date."

I can't find an answer to my problem.
Thanks in advance.
Alexey

 

Labels (4)
4 Replies
chriscammers
Partner - Specialist
Partner - Specialist

If you are writing your own load script you can name the tables whatever you want.

Qualify *;

Sales:

Load * from XYZ.qvd;

Marcos_rv
Creator II
Creator II

 

Try this:

Qualify *;

unqualify A ; // key field  

x:

LOAD

A,

B

from x.csv;

y:

join(x) 
LOAD

A,

B

from y.csv;

unqualify *;

saludos!!!

alexeyrv
Contributor II
Contributor II
Author

Yes. But goal to name fields with right prefix.
Automatický prefix of field equal to the name of SQL table or sheet in
excel.

I will try to use variables.
It gives an ability to create flexible ETL.
chriscammers
Partner - Specialist
Partner - Specialist

the naming of the fields for a qualified table happens when you load the table initially. You probably have to load Table1 qualified and then load table 2 qualified and then combine them (ie join or concatentate) in a separate step. This way the qualified names are already established.