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.
eruditio
Contributor III

Temp table not dropping (Temp-1)

Hello,

I am facing a weird phenomena.

Assume this scenario:

Script 1:

Temp:

Load * Inline [

A,

x,

];

T1:

Load * Inline [

A, C,

x, z,

y,k,

x, b,

];

Right Keep ('T1')

Load

*

Resident Temp;

Drop Table Temp;

The Output: T1 linked to Temp-1with T1 reduced in content to only x values.

Script 2

Temp:

Load * Inline [

A,

x,

];

T1:

Load * Inline [

A, C,

x, z,

y,k,

x, b,

];

Right Keep ('T1')

Temp1:

Load

*

Resident Temp;

Drop Tables Temp, Temp1;

The Output: T1 with T1 reduced in content to only x values.

Usually this doens't happen with me(or I don't notice itSmiley Happy ),  so can anyone share his insight?


Thanks,


Antoine

1 Solution

Accepted Solutions

Re: Temp table not dropping (Temp-1)

In the first script you don't specify a table name. Right Keep does keep the table, so it gets a name from Qlikview. Had you used right join instead you'd have only the reduced T1 left. This has the same effect as using right keep, giving the table the name Temp-1 and dropping Temp and Temp-1 at the end.


talk is cheap, supply exceeds demand
7 Replies

Re: Temp table not dropping (Temp-1)

I dont understand the issue?

You gave the example. But I couldn't get the issue your facing.

Re: Temp table not dropping (Temp-1)

In the first script you don't specify a table name. Right Keep does keep the table, so it gets a name from Qlikview. Had you used right join instead you'd have only the reduced T1 left. This has the same effect as using right keep, giving the table the name Temp-1 and dropping Temp and Temp-1 at the end.


talk is cheap, supply exceeds demand
eruditio
Contributor III

Re: Temp table not dropping (Temp-1)

I realise fully what you are telling me and it is correct. and makes sense...

thanks,

Antoine

eruditio
Contributor III

Re: Temp table not dropping (Temp-1)

Well, Try copying the script and running the routine for both scenarios.

     in the first one you will see a "new" table with a -1 index;

     in the second one, you will not see it.

I thought that when I issue the drop table, the original table and the resident table get dropped. Which is not the case.

So actually, I better understand now how resident load work. it actually duplicates the table, and not simply creates a reference.

MVP
MVP

Re: Temp table not dropping (Temp-1)

Just another note (if I understood correctly what you are trying to achieve):

You don't need a join / keep at all:

Temp:

Load * Inline [

A,

x,

];

T1:

Load * Inline [

A, C,

x, z,

y,k,

x, b,

] Where Exists(A);

Drop Table Temp;

Re: Temp table not dropping (Temp-1)

Why you don't use Left Keep for this case

Temp:

Load * Inline [

A,

x,

];

Left Keep(Temp)

T1:

Load * Inline [

A, C,

x, z,

y,k,

x, b,

];

Drop Table Temp;

eruditio
Contributor III

Re: Temp table not dropping (Temp-1)

An even cleaner solution !

Thank you

Antoine


EDIT: mixed up with another post

Community Browser