Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi Community,
Due some reason I am using Qualify* for many tables and after qualify and Unqualify, I am trying to get original names.
LIke:
for ex I have fields like
tab1.A
tab1.B
tab2.A
tab2.B
tab3.C
how can I rename them like A,B,C... in script
_Priya
Hi,
check out,
QUALIFY *;
T1:
LOAD * INLINE [
A, B
];
Temp:
LOAD * INLINE [
A, B
];
UnQUALIFY *;
T2:
load Temp.B,
Temp.A as A
Resident Temp;
Drop Table Temp;
You can rename by calling qualified table into resident and rename it.
-Hirish
Thanks Clever for your efforts, but this loop is changing for Tab2 only, I am trying to change code, can you please check once again from your side
Which are the names from your another tables column names?
It seems correct to me here
Check here, I could reproduce the issue
This below will check all tables, BUT if you have for example Tab1.Num and Tab.Num, you can´t rename both to Num, because of this
Rename field Tab1.Num to Num; // Will succeed ONLY it you don´t have a Num Field
Rename field Tab2.Num to Num; // Will will FAIL, since last row have created a Num field
For i = 0 to NoOfTables()-1
Let tb = TableName(i);
For j = 1 to NoOfFields(TableName(i))
let col = FieldName(j,tb);
if col like 'Tab*' then
renamingtable:
load '$(col)' as from , SubField('$(col)','.',-1) as to AutoGenerate 1;
endif
Next
Next
QUALIFY *;
Table1:
LOAD * INLINE [
Key1, Value1
abc, 200
def, 234
];
Table2:
LOAD * Inline [
Key1, Value1
D, 100
E, 200
F, 200
];
Table3:
LOAD * INLINE [
Key1, Value1
G, 100
H, 200
I, 100
];
Table4:
LOAD * INLINE [
Key1, Value1
J, 100
K, 200
L, 100
];
Table5:
LOAD * INLINE [
Key1, Value1
P, 200
Q, 300
R, 400
];
Table6:
LOAD * INLINE [
Key1, Value1
X, 2000000
Q, 300
R, 400
];
Table7:
LOAD * Inline [
Key1, Value1
M, 500000
];
UNQUALIFY *;
not working as expected ![]()
Did u try that clever's suggestion.
Perhaps you could explain why you need to use qualify and then completely undo the qualify?
-Rob
Hi Rob, I am doing partial load after the unqualify for a table....replace load tab1.key, tab1.value from my excel