Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

Qualify Name change

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

Labels (1)
22 Replies
HirisH_V7
Master
Master

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

HirisH
priyarane
Specialist
Specialist
Author

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

Clever_Anjos
Support
Support

Which are the names from your another tables column names?

It seems correct to me here

Clever_Anjos
Support
Support

Check here, I could reproduce the issue

Clever_Anjos
Support
Support

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 

priyarane
Specialist
Specialist
Author

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 *;

priyarane
Specialist
Specialist
Author

not working as expected

HirisH_V7
Master
Master

Did u try that clever's suggestion.

HirisH
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Perhaps you could explain why you need to use qualify and then completely undo the qualify?

-Rob

priyarane
Specialist
Specialist
Author

Hi Rob, I am doing partial load after the unqualify for a table....replace load tab1.key, tab1.value from my excel