Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gizzel123
Creator
Creator

load top n rows from database in load statement

Hey Guys,

Can we load just top 10  rows from database instead of the whole table . so that I can create QVD and thus the data model for time being.

Loading the whole table is taking time, which I can do later, right now my priority is to create  data model.

Please help.

thanks in Advance

5 Replies
its_anandrjs

Hi,

Yes you can do this with different ways

1. Use First Key word put First 10 before the load statement

Ex:-

First 10

Load *

From SourceLocation;

2. And with Rowno() function you can also do this

Load *

From Source Where Rowno() <=10;

3. By the debug option in the edit script click Ctrl + E >> and then Debug >> and select limited load >> and select 10

By this you can load first 10 records.

Read the attached blog url also.

Regards

Anand

Anonymous
Not applicable

Thanks Gizzel123 for the question and Anand for the answer.

It's not my question so I won't mark it as 'Answered', but it is exactly what I was looking for.

alexandros17
Partner - Champion III
Partner - Champion III

You can do it even in sql select (according to the SQL) with mysql you can use Limit keyword, with MSSQL you can use TOP keyword, each DB has its own keyword.

hope it helps

rubenmarin

Hi, also, in script you can clic on 'Debug', check 'Limited load' and set the rows to load for each table.

Anonymous
Not applicable

Good suggestion.  I would normally do the TOP # in t-SQL - but in my case, I was doing a read from an inline table so used your first suggestion.