Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rajender_qlik
Creator
Creator

QVD load filter

Hi everyone,

I have QVD in this format below as shown.

           DateTime            Column1       Column2

  

8/16/2017 0:00:306.28772427.69061
8/16/2017 0:01:006.24808127.69014
8/16/2017 0:01:306.29302827.68986
8/16/2017 0:02:006.24844327.68856
8/16/2017 0:02:306.28197527.68705
8/16/2017 0:03:006.25563527.68851
8/16/2017 0:03:306.28005227.68943
8/16/2017 0:04:006.26065627.6895
8/16/2017 0:04:306.25772627.68903
8/16/2017 0:05:006.27170827.69188
8/16/2017 0:05:306.22217527.68902
8/16/2017 0:06:006.26929627.6888
8/16/2017 0:06:306.3164627.68938
8/16/2017 0:07:006.3167927.69238
8/16/2017 0:07:306.28712827.68573
8/16/2017 0:08:006.31255127.68866
8/16/2017 0:08:306.32765927.68919
8/16/2017 0:09:006.24047927.68662
8/16/2017 0:09:306.28112627.69056
8/16/2017 0:10:006.26426727.69086
8/16/2017 0:10:306.25717327.6921

So I need to give a filter while loading QVD so it loads row1 and deletes row2& 3 and loads row4 and so on...

Can anyone let me know what is the filter we need to use while loading this QVD.

Thanks for any help!!

1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Rajender,

Consider this table:

  

RecNo()Mod(RecNo()-1,7)
10
21
32
43
54
65
76
80
91
102
113
124
135
146
150
161
172
183
194
205

you'll see that the where clause to use is

WHERE Mod(RecNo()-1,7) <=1


Regards


Andrew

View solution in original post

8 Replies
lorenzoconforti
Specialist II
Specialist II

So, if I understand correctly you need to delete every second and third row?

If that's the case, you could load first the QVD then with NoConcatenate reload it from resident into a new table with a for loop; use a counter to avoid loading the second and third row; then drop the original table

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

LOAD *

FROM myqvd.qvd (qvd)

WHERE NOT Match(RecNo(), 2, 3);

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

rajender_qlik
Creator
Creator
Author

Hi Lorenzo,

Thanks for your reply on this post.

Can you please post a sample script So it will be more helpful.

rajender_qlik
Creator
Creator
Author

Hello Rob,

Thanks for you reply on this post.

I want to load QVD  first row and delete 2 & 3 rows, load 4th row and delete 5 & 6 rows and so on.

If you have any script please post here so it will be helpful.

effinty2112
Master
Master

Hi Rajender,

Try:

LOAD *

FROM myqvd.qvd (qvd)

WHERE Mod(RecNo()-1,3) = 0;

Regards

Andrew

rajender_qlik
Creator
Creator
Author

Hi Andrew,

Thanks for your reply.

Do you know how to load 2 rows and skip 5 rows and load 2 rows again and skip 5 rows and so on using QVD load.

effinty2112
Master
Master

Hi Rajender,

Consider this table:

  

RecNo()Mod(RecNo()-1,7)
10
21
32
43
54
65
76
80
91
102
113
124
135
146
150
161
172
183
194
205

you'll see that the where clause to use is

WHERE Mod(RecNo()-1,7) <=1


Regards


Andrew

rajender_qlik
Creator
Creator
Author

Thanks Andrew Walker for your reply & that really helped me.