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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Drop fields with *

Hi,

In a script after a LOAD I have to delete some empty fields of a table, that are like 'FIELD1', 'FIELD2', 'FIELD3', etc.

Is there any possibility to delete dynamicaly like:

DROP Fields FIELD* From TABLE ?

1 Solution

Accepted Solutions
Not applicable
Author

Oh okay... This is one other site I stumbled across about a wildcard search for dropping fields

Qlik Tips: Removing Fields with a Wildcard

View solution in original post

4 Replies
Not applicable
Author

Here is a solution from anther discussion posted....

http://community.qlik.com/message/172747

Anonymous
Not applicable
Author

It's not really a solution, but I solved my problem the same way with a loop:

for i = 1 to 15

    LET TempFieldName = 'Demandes_ICCOUT' & $(i);

    IF FieldNumber('$(TempFieldName)','Demandes') <> 0 then

        Drop Field $(TempFieldName) From Demandes;

    ENDIF;

next i

The fact is that in my example I have 15 fields that can exists.

What I want is to know if I could solve the problem with any number or caracters, with just a prefix like:

Drop Fields 'Demandes_ICCOUT*' From Demandes

Not applicable
Author

Oh okay... This is one other site I stumbled across about a wildcard search for dropping fields

Qlik Tips: Removing Fields with a Wildcard

Anonymous
Not applicable
Author

Thanks! That's what I was expecting for, I will be able to make my own solution.