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

First (100) SQL Select Distinct

I would like to limit sql load to 1000 rows, that will really help me test, the SQL database is very large.

The code below is pulling all the data from sql, how can I limit this before a Qlikview preceding load?

Load *;

First (100) SQL SELECT DISTINCT * FROM xyz;

Thanks

Neil

10 Replies
Anonymous
Not applicable

You can debug and limit the load on 100 rows.

sunny_talwar

May be this:

SQL SELECT DISTCINT *

FROM xyz

WHERE ROWNUM <= 1000;

Other options can be found here: SQL SELECT TOP, LIMIT, ROWNUM

benvatvandata
Partner - Creator II
Partner - Creator II

Similar to what Sunny T said, try:

LOAD *;

SQL SELECT DISTINCT TOP 1000 *

FROM xyz;

Anonymous
Not applicable

Or you can do

Load *;

SQL

SELECT DISTINCT top(1000) * FROM xyz;

Clever_Anjos
Employee
Employee

IF you´re using:

Oracle:

SELECT * FROM TABLE where ROWNUM < 100;

SQL Server

SELECT top (100) * FROM TABLE

MySQL

SELECT * FROM TABLE limit 100

beck_bakytbek
Master
Master

Hi Neil,

Are you working with SQL-Server? From wich Database do you connect your tables?

vcanale
Partner - Creator II
Partner - Creator II

Hi,

You can use the First prefix:

Limited Load and the First Prefix

Anonymous
Not applicable

To answer your question:

To do it with preceeding load:

Tablename:

First 100

Load *;

SQL SELECT DISTINCT * FROM xyz;

What Db are you using?

Anil_Babu_Samineni

Another way could be this

=if(aggr(rank(sum(DISTINCT Sales)),Dimension)<=100,Dimension)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful