Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
rsundarraj
New Contributor III

Drop Temp all the Files in the App

Hi All,

I have created several temp Fields in a App.

Like tempabcd, tempbox , tempram , tempmax.

Now I want to drop all the temp Fields with one syntax.

Please help me on the same

11 Replies

Re: Drop Temp all the Files in the App

Drop fields fiedsname1,fieldname2 ;

etc 

Re: Drop Temp all the Files in the App

One or several QlikView fields can be dropped from the data model and thus from memory at any time during script execution, by means of a drop field statement.
The syntax is:

drop field[ s ] fieldname [ , fieldname2 ...] [from tablename1 [ , tablename2 ...]]

Both drop field and drop fields are allowed forms with no difference in effect.
If no table is specified, the field will be dropped from all tables where it occurs.

Examples:

drop field A;

drop fields A,B;

drop field A from X;

drop fields A,B from X,Y;

rsundarraj
New Contributor III

Re: Drop Temp all the  Files in the App

I have more than 20 fields ...will Drop tables '*_temp';

Re: Drop Temp all the Files in the App

no I don't think your syntax will work, you need to specify all the fields

Gabriel
Valued Contributor II

Re: Drop Temp all the Files in the App

Hi,

May be try this

SUB DropTable(TableName);

   

IF LEFT(TableName,4) ='Temp' THEN

    DROP TABLE [$(TableName)];

ENDIF

END SUB

Then after each table you will have a CALL function as this

CALL DropTable('TempRESULT')

Hopefully this will start a thinking

Re: Drop Temp all the Files in the App

The community always supplies you with one or more answers, if you take the time to perform a search.

This one may help you: Qlik Tips: Removing Fields with a Wildcard

Peter

rsundarraj
New Contributor III

Re: Drop Temp all the  Files in the App

Unluckily it doesn't work in my location

Re: Drop Temp all the Files in the App

Yes, I noticed that the link is dead. Weird because it points to the blog of stephen-x.redmond. I also know this to be a QlikView Cookbook for Developers article (by the same author), don't know if you got that one?

I'm sure the site is only temporarily off-line.

Peter

MVP
MVP

Re: Drop Temp all the Files in the App

The link to Stephen's blog works fine for me.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser