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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ClemByr
Contributor
Contributor

Load a table based on rows range with SQL

Hi,

I'm loading a table using OLE DB connector and I want to split the table into data chunk. The issue is that I'm trying to define a LIMIT in the SQL part to define a range of rows to work on.

 

[My_Table]:
Load *;

SQL select *

FROM "TablePath/My_table"
LIMIT 10,10;

 

With the script above, I'm supposed to retrieve rows 11-20 but the comma for LIMIT is refused by the Qlik loading script.

Can anyone help me on this ?

Labels (3)
2 Replies
Kushal_Chawda
MVP
MVP

@ClemByr  try below

SQL SELECT a.*
    FROM 
        (
         SELECT *, 
                ROW_NUMBER() OVER (ORDER BY Column1,Column2) AS row_number 
         FROM Table
         ) a
WHERE a.row_number between 11 and 20;
marcus_sommer
MVP
MVP

You may try to wrap the part with brackets or quotes like (10,10) or "10,10" or to assign the limit to a variable which is then called like '$(vLimit)' or similar measurements to bypass the Qlik-script parser-issue.

Beside this if your essential bottleneck is the network-traffic you may have a functional workaround by suggestion from @Kushal_Chawda.But is the bottleneck the data-base performance/workload the sub-query approach would go in the opposite direction.

Did you already try different ways of the specifying the limit (it may depend on the data-base and the used driver which kind of syntax is valid and supported), like:

LIMIT 10 OFFSET 10;