Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have three tables and im using qualify on both to rename the fields but unqulaifying one field that which i rename to be the join between all three tables.
The problem is that two tables will join but I cant get the second table's field to rename!! Ive tried rename field To , rename as within the load..
How can I rename the field in the qualify of the second table so that all three tables will join ?
QUALIFY *;
UNQUALIFY fieldname1;
Filteredtable1:
SQL SELECT *,
1 AS countfields
FROM "ABC".dbo."Filteredtable1";
UNQUALIFY *;
QUALIFY *;
UNQUALIFY fieldname2 ;
Filteredtable2:
SQL SELECT *,
1 AS countfields
FROM "ABC".dbo."Filteredtable2";
UNQUALIFY *;
Filteredtable3:
SQL SELECT *,
fieldname3 as fieldname1 , //// JOIN
1 AS countfield
FROM "ABC".dbo."Filteredtable3";
And have you tried:
rename field ABC to XYZ from Filteredtable2;
Hi,
I think you need to mention the Tablename also.. like
Rename field Filteredtable2.FieldName to FieldName;
Not really sure what you are trying to achieve. Some sample lines of data and expected result may help to understand.
These tables link on fieldname1:
QUALIFY *;
UNQUALIFY fieldname1;
Filteredtable1:
LOAD *, 1 AS countfields INLINE [
fieldname1, fieldname2, fieldname3
1,1,1
];
UNQUALIFY *;
QUALIFY *;
UNQUALIFY fieldname1 ;
Filteredtable2:
LOAD fieldname2 as fieldname1, fieldname3, 1 AS countfields INLINE [
fieldname2, fieldname3
,1,1
];
UNQUALIFY *;
Filteredtable3:
LOAD fieldname2, fieldname3 as fieldname1, 1 AS countfields INLINE [
fieldname2, fieldname3
1,1
];
yes doesnt seem to rename the field or says the fieldname is already in use.
swuehl im trying to join three tables loaded via sql and qualify two of the tables apart from the single field from all three that will be the join.
I have to also rename the field though and I can only seem to rename in one of the table loads?
I believe there are limitations on RENAME of / to key fields, because there is more involved than just changing the name. So I think you need to go for AS in table load.
hello,
that only seems to work in the last table load but its in the second table that i want to rename a field with as but it appears' to do nothing?
Have you checked my previous post including the script code? I renamed in both table loads a field to fieldname1, thus having all tables linked by fieldname1.
If this does not work for you, please post an potentially executable script (e.g. using INLINE tables like above) that shows your setting.