Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

optimize query with qvd

I have the following query

with temp as(select distinct  [datecol],[Code Article],[Code Structure],[Code Site]

           from [Vente] t2

            where promo = 0

            and ([Code Article] is not null) and ([Code Structure] is not null) and ([Prix de Revient] is not null ))

select * from(

select distinct [datecol],[Code Article],[Code Structure],[Code Site],

      row_number() over(Partition by  [Code Article],[Code Structure],[Code Site] order by [datecol]desc ) as rn

      from temp

) d where   rn <= 28

How to do the same idea within QVD ?

1 Reply
settu_periasamy
Master III
Master III

Hi,

May be you can Load All the data using Select * , then you can limit the data using Load statement.

Like

LOAD Distinct   [datecol],
[Code Article],
[Code Structure],
[Code Site] Where rn<=28 Order by [datecol] desc;
SELECT * From YourTableName;