Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Table Alias Name

Hi All,

I want to change the field below names and give alias name by not using "as" function in my script. Can any one help me here?

Also pls explain me how it will work.

GC_2:

LOAD Year,
[CONTRACT EFFECTIVE DATE],

    
[CONTRACT EXPIRY DATE],

    
CATEGORY,

    
[Facility Of Benefit],

    
STATUS ,

    
[CLAIM TYPE] ,

    
[SPEC ASSESSMENT],

    
[TREATMENT DATE],

    
[INVOICE NUMBER],

    
[AUTHORIZATION NUMBER],

    
PROVIDER,

    
SERVICE,

    
[ITEM CPT CODE],

    
[QTY APPROVED],

    
[CLAIMED AMOUNT],

    
[APPROVED AMOUNT],

    
[ITE MBENEFICIARY SHARE]

FROM

[..\Data\GC_-_SAMPLE_2.xlsx]

(
ooxml, embedded labels, table is GC1);

Rgds,

Nandha

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

QUALIFY *;

GC_2:

LOAD Year,
[CONTRACT EFFECTIVE DATE],

    
[CONTRACT EXPIRY DATE],

    
CATEGORY,

    
[Facility Of Benefit],

    
STATUS ,

    
[CLAIM TYPE] ,

    
[SPEC ASSESSMENT],

    
[TREATMENT DATE],

    
[INVOICE NUMBER],

    
[AUTHORIZATION NUMBER],

    
PROVIDER,

    
SERVICE,

    
[ITEM CPT CODE],

    
[QTY APPROVED],

    
[CLAIMED AMOUNT],

    
[APPROVED AMOUNT],

    
[ITE MBENEFICIARY SHARE]

FROM

[..\Data\GC_-_SAMPLE_2.xlsx]

(
ooxml, embedded labels, table is GC1);

Your resulting load will have the field names renames as Tablename.Fieldname

Eg. [GC_2.Approved Amount]

Hope it helps

View solution in original post

7 Replies
kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

If you say

Qualify *;

This will qualify all the fields such that they are tablename.fieldname.

Example

Qualify *;

Table1:

LOAD

A,

B

FROM DataSource;

Anonymous
Not applicable
Author

Hi Kumar,

Yes you are right its Qualify.

I have given my script in this discussion. Can you pls explain me or step by step process for this Qualify concept?

Rgds,

Nandha

er_mohit
Master II
Master II

using qualify *;

you get the fieldname new(i.e tablename.fieldname)

before loading table write qualify *;

then after loading statement and reloading that you can get the fields with name of tablename.fieldname

like

a:

LOAD * INLINE [

    data, value

     qwr, 10

      wee, 20

       www, 30

         g, 40

         y, 50

         tyui, 60

];

spacemap:

Mapping LOAD

Repeat(' ',RecNo()),' '

AutoGenerate 10;

QUALIFY*;

LOAD 

data,

value,

MapSubString('spacemap',Trim(data))as y

Resident a ;

DROP Table a;

hope it helps you.

khadeer
Specialist
Specialist

Add before your load:

Qualify *;

Anonymous
Not applicable
Author

QUALIFY *;

GC_2:

LOAD Year,
[CONTRACT EFFECTIVE DATE],

    
[CONTRACT EXPIRY DATE],

    
CATEGORY,

    
[Facility Of Benefit],

    
STATUS ,

    
[CLAIM TYPE] ,

    
[SPEC ASSESSMENT],

    
[TREATMENT DATE],

    
[INVOICE NUMBER],

    
[AUTHORIZATION NUMBER],

    
PROVIDER,

    
SERVICE,

    
[ITEM CPT CODE],

    
[QTY APPROVED],

    
[CLAIMED AMOUNT],

    
[APPROVED AMOUNT],

    
[ITE MBENEFICIARY SHARE]

FROM

[..\Data\GC_-_SAMPLE_2.xlsx]

(
ooxml, embedded labels, table is GC1);

Your resulting load will have the field names renames as Tablename.Fieldname

Eg. [GC_2.Approved Amount]

Hope it helps

jagan
Luminary Alumni
Luminary Alumni

Hi Nandha,

Please find below example

Qualify *;

X:

Load A,B from x.csv;

Now column A is renamed as X.A and B is renamed as X.B.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi Nandha,

may be you can use the "rename fields" - statement with a prior defined mapping table. Similar to this:

// create Table with aliases via mapping load:

FieldMap:

Mapping Load * inline [

OldName, NewName

Year, NewYear
CONTRACT EFFECTIVE DATE,  MyContractDate

]; // one line per field to rename

// now the normal load :

LOAD Year,
[CONTRACT EFFECTIVE DATE],

. . . .

// rename the fields listed in mapping table "FieldMap":

RENAME Fields using FieldMap;

HtH

Roland