Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Limit SQL Rows Loaded

Good day,

I have been tasked with loading the old script into Qlik and am having some trouble as there are over 10million rows in the subquery.

What i need is to limit the data loaded during testing as my 6GB of RAM is not enough.

My questions are as follows:

1. Looking at the code bellow have you used the correct code / code structure to achieve what is needed.

2. How do i limit the ROW's loaded for testing purposes. I have looked at "FIRST" and "BUFFER" but do not see those helping. What am i missing here. I have tested the code in MySQL Workbench with a load limit and all works fine.

OLD SCRIPT - Some sort of reporting system

pricing

SELECT

`stock_management1`.`st_prodcode`,

`stock_management1`.`st_sdesc`,

`stock_management1`.`st_mstockist`,

`stock_management1`.`APS_rol`,

`stock_management1`.`APS_eoq`,

`stock_management1`.`APS_ms`

FROM   `pricing`.`stock_management` `stock_management1`

WHERE  (`stock_management1`.`st_mstockist`='BRA'

OR `stock_management1`.`st_mstockist`='FCS'

OR `stock_management1`.`st_mstockist`='FKE')

AND `stock_management1`.`APS_ms`>0

EXTERNAL JOIN

stock_management1.st_prodcode={?APS: ITEM1.ST_Prodcode}

AND stock_management1.st_prodcode={?FCS: stocktake1.S_ProdCode}

AND stock_management1.st_prodcode={?CENTRAL: Command.mv_PRODCODE}

NEW QLIK CODE

PRICING:

buffer SQL SELECT `APS_eoq`,

    `APS_ms`,

    `APS_rol`,

    stock_management.`st_mstockist`,

    stock_management.`st_prodcode`,

    stock_management.`st_sdesc`

FROM  pricing.`stock_management`

Left Join (aps.`item`, cstores.`stocktake`, central.`mvmnt`)

ON pricing.`stock_management`.`st_prodcode` = aps.`item`.`ST_Prodcode`

AND pricing.`stock_management`.`st_prodcode` = cstores.`stocktake`.`s_prodcode`

AND pricing.`stock_management`.`st_prodcode` IN (SELECT MV_PRODCODE

FROM central.`outstanding_stv`

INNER JOIN central.`mvmnt` on central.`mvmnt`.`MV_TRANNO` = central.`outstanding_stv`.`IS_INVNO`

WHERE R_BRANCH="APS")

WHERE `stock_management`.`APS_ms`>0

AND `stock_management`.`st_mstockist`="BRA"

OR `stock_management`.`st_mstockist`="FCS"

OR `stock_management`.`st_mstockist`="FKE";

I am fairly new to Qlik and any help would be greatly appreciated.

Thank you

10 Replies
AlbaJPDupe
Contributor
Contributor

Dear all,

 

I tried this code and it works for me:

Table:

Load *

;

First 1000

SQL Select

*

From table_name;

 

Hope it helps 🙂

Regards,

Alba