Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasmahajan

How to delete records from QVD where FLAG=1

Dear All,

I have ALLDATA.QVD  with  FileName as  AssetTrackingAUG1,SEP1 etc   also  I have another table

Temp_FileNames with Flag .  Now I want to delete records from QVD where Flag = 1 .

Help appreciated.

Thanks in adv

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Tab:

Load

          *

From ALLDATA.QVD (qvd);

Inner Join

Load

          *

From Temp_FileNames.qvd (qvd) where Flag =0;


Store Tab into ALLDATA.QVD (qvd);

Drop table Tab;

View solution in original post

8 Replies
MK_QSL
MVP
MVP

Not understood..

You have two fields... one QVD and one Excel.

You want to delete records from QVD where Flag = 1... is this Flag in both files or not?

vikasmahajan
Author

Thanks for reply

I have 2 tables ALLDATA.QVD  & Temp_FileNames with Flag (0 or 1)   from ALLDATA.QVD  i want to delete records

who's flag is 1


Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
MK_QSL
MVP
MVP

What is the common field between them?

vikasmahajan
Author

FileName

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
MK_QSL
MVP
MVP

FileName is the QVD name or its a field in QVD?

if it is a field in QVD,

T1:

Load * From QVD...
Left Join

Load FileName, Flag From ExcelFile;

NoConcatenate

T2:

Load * Resident T1 Where Flag = 1;

Drop Table T1;

Drop Field Flag;

Strore T2 into T2.qvd(QVD);

tresesco
MVP
MVP

Try like:

Tab:

Load

          *

From ALLDATA.QVD (qvd);

Inner Join

Load

          *

From Temp_FileNames.qvd (qvd) where Flag =0;


Store Tab into ALLDATA.QVD (qvd);

Drop table Tab;

vikasmahajan
Author

Thanks Manish

I use tresesco's approach.

Thanks all

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
MK_QSL
MVP
MVP

Obviously tresesco's approach is better than my approach.

Let me explain you one more scenario..

Consider that in QVD you have below filenames.

FileName

FileName1

FileName2

FileName3

FileName4

and in Excel file you have

FileName          Flag    

FileName1          1    

FileName2          0    

FileName3          1

Now using both of our reply (my one and Tresesco's reply) you will miss FileName4.

You can use below to get FileName4 also in your final QVD.

T1:

Load * From QVD...
Left Join

Load FileName, Flag From ExcelFile;

NoConcatenate

T2:

Load * Resident T1 Where Flag <> 0;

Drop Table T1;

Drop Field Flag;

Strore T2 into T2.qvd(QVD);

If you have exact match of FileName in both tables, you should use tresesco's reply !