Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

Full load issue

Hi all,

when i try to load the below script it is working fine when  we use where condition in script  ,

but the issue is when i remove the where condition  its not loading the scrpit?

Can anyone help on this?

stk_temp:

NoConcatenate

load brcode,  

     item_code, 

     dt,

      qty

from

(qvd)

//where dt >='01-04-2016' and dt <='30-06-2016'

;

stk:

NoConcatenate

LOAD brcode,  

     item_code, 

     dt,

      qty

Resident stk_temp

//where match(brcode,'002','003') and dt >='01-04-2016' and dt <='30-06-2016'

     order by brcode,item_code,dt

          ;

    

drop Table stk_temp;

stk_temp:

NoConcatenate

load Distinct dt

from

(qvd)

where dt >='01-04-2016' and dt <='30-06-2016'

;

left join(stk_temp)

load Distinct brcode

from

(qvd)

//where match(brcode,'002','003') and dt >='01-04-2016' and dt <='30-06-2016'

left join(stk_temp)

load Distinct item_code

from

(qvd)

//where item_code='I69195', and dt >='01-04-2016' and dt <='30-06-2016'

//where match(item_code,'I69195','I65538','I00197','I00303','I00319','I00157','I00158','I00186','I00187') and dt >='01-04-2016' and dt <='30-06-2016'

;

//exit Script;

left join(stk_temp)

load *

Resident stk;

drop Table stk;

stk:

NoConcatenate

load brcode,

item_code,

dt,

sum(qty) as qty

Resident stk_temp

Group by

item_code,brcode,dt;

drop Table stk_temp;

stock_temp:

NoConcatenate

LOAD brcode,

item_code,

dt,

qty,

if(item_code=Previous(item_code) and brcode=Previous(brcode),peek('cum_qty')+qty,qty) as cum_qty

Resident stk

order by

item_code,

brcode,

dt

;

drop Table stk;

STOCK:

NoConcatenate

load

brcode,

item_code,

date(dt) as dt,

qty,

cum_qty,

if(cum_qty=0,1,0) as zero_stock_flag

Resident stock_temp

order by

brcode,

item_code,

dt

;

drop Table stock_temp;

StockZero:

load

brcode,

item_code,

MonthEnd(dt) as tran_date,

//qty,

//cum_qty,

//zero_stock_flag,

Count(zero_stock_flag) as all_Days_zero

// match(zero_stock_flag,'30','31') as ItemNeverSold

resident STOCK

where zero_stock_flag=1

group by

brcode,

item_code,

MonthEnd(dt)

;

drop table STOCK;

7 Replies
sunny_talwar

Removing all the where statements? When it is not loading, it is giving an error message? What is the error?

sunny_talwar

Missing a semi-colon

Capture.PNG

Anonymous
Not applicable

; is missing for commented where conditions.

Chanty4u
MVP
MVP
Author

bro,

when i remove where condition  script is not running,

its closing . without error only....

@ semicoloumn is not issue i corrected bro

sunny_talwar

Can you share the log file?

Kushal_Chawda

Best way to decode is run one by one LOAD statement and check the output. After adding next load when issue comes up that means there is something wrong in that LOAD

Chanty4u
MVP
MVP
Author

yes done kush,

from below table it is not loading

stock_temp:

NoConcatenate

LOAD brcode,

item_code,

dt,

qty,

if(item_code=Previous(item_code) and brcode=Previous(brcode),peek('cum_qty')+qty,qty) as cum_qty

Resident stk

order by

item_code,

brcode,

dt

;

drop Table stk;

STOCK:

NoConcatenate

load

brcode,

item_code,

date(dt) as dt,

qty,

cum_qty,

if(cum_qty=0,1,0) as zero_stock_flag

Resident stock_temp

order by

brcode,

item_code,

dt

;

drop Table stock_temp;

StockZero:

load

brcode,

item_code,

MonthEnd(dt) as tran_date,

//qty,

//cum_qty,

//zero_stock_flag,

Count(zero_stock_flag) as all_Days_zero

// match(zero_stock_flag,'30','31') as ItemNeverSold

resident STOCK

where zero_stock_flag=1

group by

brcode,

item_code,

MonthEnd(dt)

;