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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Direct Query

Hi all,

Quick question : with using Direct query, is there another way to create a different condition

In tech doc, it explains that when you select 10 id of customer ID, Qlikview creates this SQL :

SELECT DISTINCT "SalesPersonID" FROM "AdventureWorks"."Sales"."SalesOrderHeader" WHERE

"CustomerID" IN ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 )

But, if you have 10 000 customerID selected you have this SQL

SELECT DISTINCT "SalesPersonID" FROM "AdventureWorks"."Sales"."SalesOrderHeader" WHERE

"CustomerID" IN ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 .. 10000)

So it's not performant for a SQL Server, it will be more performant with this SQL

SELECT DISTINCT "SalesPersonID" FROM "AdventureWorks"."Sales"."SalesOrderHeader" WHERE

"CustomerID" > 1

and "CustomerID" < 10001

Any ideas ?

thanks

1 Reply
rustyfishbones
Master II
Master II

Add FIRST before the LOAD statement, maybe like below, it will only load the first 10 rows from the Database

2014-01-22_1641.png

You could say FIRST 10000 and then ORDER BY CustomerID