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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
etrotter
Creator II
Creator II

Mapping Table Dropping Fields

Hi, I am trying to drop fields while also renaming. All the fields I do not want are renamed as numbers, I tried to create an if statement that would drop the unwanted fields but it is not working. Let me know if anyone has any ideas!

Here is my script:

Initiative__c:

LOAD

*;

Select *

FROM Initiative__c;

FieldMapInitiative__c:

MAPPING

LOAD Field,

     Rename

FROM

[lib://AttachedFiles/FieldMap.xlsx]

(ooxml, embedded labels, table is Initiative__c)

WHERE len(Rename)>0

& if(Field=num(0-100),drop);

Rename Fields using Initiative__c;

3 Replies
sunny_talwar
MVP
MVP

May be this

FieldMapInitiative__c:

MAPPING

LOAD Field,

    Rename

FROM

[lib://AttachedFiles/FieldMap.xlsx]

(ooxml, embedded labels, table is Initiative__c)

WHERE len(Rename)>0 and IsText(Field);

etrotter
Creator II
Creator II
Author

it is still showing the fields, it must be reading the numbers as text.

I can also change the names in the field map if that helpful

sunny_talwar
MVP
MVP

How about this?

FieldMapInitiative__c:

MAPPING

LOAD Field,

    Rename

FROM

[lib://AttachedFiles/FieldMap.xlsx]

(ooxml, embedded labels, table is Initiative__c)

WHERE len(Rename)>0 and not IsNum(Num#(Field));