Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
While loading the data from a file I have renamed certain fields into common names ( as AGENT_CODE as CODE). Now in case I further want to do some further modifications in the script with the renamed fields, do I need to use the original field name ( AGENT_CODE ) or can I use the new name ( CODE)?
Thanks for the help
hi umang,
the point in your script is that when you rename AGENT_CODE as Code,AGENT_AGE as Age in the load statement,these fields (Code & Age) are not yet created ,they are still being created as newfields(Code & Age) in the load statement. while on the other hand, AGENT_CODE &AGENT_AGE are already there in the table ABC.xlsx from which u are loading these fields. so what u can do is this
tab1:
LOAD
AGENT_CODE as Code,
AGENT_NAME as Name,
AGENT_AGE as Age
FROM ABC.xlsx (ooxml, embedded labels, table is Sheet1);
tab2:
load Code&Age as Unique resident tab;
thanks
Hello,
by using resident to load the fields or using load before load you have to use the new name (CODE).
The new name is given after finishing loading the table.
Sorry Martin - I could not quite get you
I go with Martin, but I guess double 'as' is some typing mistake
( as AGENT_CODE as CODE)
Hi umang,
When u rename the orginal name to new name u should have to use new name.
eg:
AGENT_CODE AS CODE
use renamed field CODE as further change.
Regard's
Naren.
Guys,
Maybe I could explain my problem. Below is my script
LOAD
AGENT_CODE as Code,
AGENT_NAME as Name,
AGENT_AGE as Age,
Code & Age as Unique
FROM ABC.xlsx (ooxml, embedded labels, table is Sheet1);
When I concatenate Code & Age, QV gives me an error but if i use AGENT_CODE and AGENT_AGE then the same works perfectly.
Is there some by which I can use Code & Age rather than the original names
hi umang,
the point in your script is that when you rename AGENT_CODE as Code,AGENT_AGE as Age in the load statement,these fields (Code & Age) are not yet created ,they are still being created as newfields(Code & Age) in the load statement. while on the other hand, AGENT_CODE &AGENT_AGE are already there in the table ABC.xlsx from which u are loading these fields. so what u can do is this
tab1:
LOAD
AGENT_CODE as Code,
AGENT_NAME as Name,
AGENT_AGE as Age
FROM ABC.xlsx (ooxml, embedded labels, table is Sheet1);
tab2:
load Code&Age as Unique resident tab;
thanks
Thanks tauqueer,
but in this case the two tbas would be seperate and would not be associated with each other right?
I got it just need to do take a common field in the new tab and do a join to merge the two sets thanks
hi umang,
u can do a left join
tab1:
LOAD
AGENT_CODE as Code,
AGENT_NAME as Name,
AGENT_AGE as Age
FROM ABC.xlsx (ooxml, embedded labels, table is Sheet1);
left join (tab1)load Code&Age as Unique resident tab;
thanks