Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

etrotter
Contributor 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

Re: Mapping Table Dropping Fields

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
Contributor II

Re: Mapping Table Dropping Fields

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

Re: Mapping Table Dropping Fields

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

Community Browser