Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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;