Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Case insensitive load

Hi everybody,

In script I am reading data from an existing qvd file. The script can not see filed 'field1' if in qvd it is 'FIELD1'. Some of the fields are in upper case, others are in lower. How can I make it case insensitive? I tried FORCE UPPER CASE, but it didn't help.

4 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi Volha,

It looks like an adventure, but it can be as variant

//set the mode of ignoring errors

set ErrorMode=0;

LOAD

[Variant1 Field Name]

...

FROM

...

If ScriptError>0  //did not guess the name of the field

LOAD

[Variant2 Field Name]

...

FROM

...

End If

........

If ScriptError>0  //did not guess the name of the field

LOAD

[VariantN Field Name]

...

FROM

...

End If

//set mode errors default

set ErrorMode=1;

Regards,

Andrey

Not applicable
Author

Hi,

Use Upper() in script and for column names in you can use alise name

try like'

Upper(fieldName) as FIELDNAME

Regards,

Swathi

prieper
Master II
Master II

So you read different qvds with changing fieldnames???

You may use a script like:

MyTable: LOAD * FROM .....qvd;

FOR i = 1 TO NOOFFIELDS('MyTable')

LET sOldField = FIELDNAME(i, 'MyTable');

LET sNewField = UPPER(sOldField);

RENAME FIELD $(sOldField) TO $(sNewField);

So you have all fields in Upper-case and continue with uniform names.

Peter

Anonymous
Not applicable
Author

Hi All,

Actually it helped to avoid an issue with case insensitivity when I install Hortonworks driver instead of Cloudera.