Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load Script Error

Hi,

I have written a script that works on a stand-alone unit but it doesn't work on a Qlikview server (see script below). I get a ErrorCount = 3 which means there's something wrong with the script.

The function of the application is that a buyer can enter a status for a Purchase Order. The user selects a purchase order in a Qlikview Table and enters the status. The status is saved to an SQL database. The status i updated on the Qlikview app using partial reload via EDX call.

The first LOAD returns the status and the timestamp when it was entered from an SQL database.

The second LOAD sorts the status (to get the latest entered status) and only fetches status entered during the current week.

The third LOAD uploads the purchase order data from a text file.

The purchase order data is the joined with the status from the SQL database.

The fourth LOAD reloads the joined purchase order table and and sets the status to "Open" if the purchase order doesn't have a entered status in the SQL database

Can someone see what's wrong? Something to do with the REPLACE LOAD?

Best Regards,
Jonas

---

tmp_sqlPO_1:
CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=qlikview;Initial Catalog=qlikview;Data Source=OER1EUWEBW01;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=OER1EUNB136926;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is WeVWYAJMDLMETZQK);
REPLACE LOAD po_key,
"d_timestamp" as POtimestamp,
status as tmp_POstatus;
SQL SELECT *
FROM qlikview.dbo."purchase_comment";

tmp_sqlPO:
REPLACE LOAD po_key,
FirstSortedValue(tmp_POstatus,-POtimestamp) as tmp_POstatus
resident tmp_sqlPO_1
where week(today())=week(POtimestamp)
group by po_key;

drop table tmp_sqlPO_1;

tmp_PO:
REPLACE LOAD ([PO Num] & [Release Line Schedule]) as po_key,
[Orig Action] as [PO Action],
[PO Num] as [PO Number],
[Release Line Schedule] as [PO Line],
[Aging Ct] as [PO Aging],
Buyer as [PO Buyer],
[Item Number] as [PO Item],
Description as [PO Description],
[Orig Qty] as [PO Qty],
[Buyer Cancel Qty] as [PO Cancel Qty],
[Current Dock Date] as [PO Promise Date],
[Orig Buyer Dock Date] as [PO Need Date],
[Supplier Name] as [PO Supplier],
[PO Amt (USD)] as [PO Amount],
RecNo() AS CounterPO
FROM _indata\AllAction_thisweek.xls (biff, embedded labels, table is [All Actions Detail$]);

join load * resident tmp_sqlPO;
drop table tmp_sqlPO;

PO:
REPLACE LOAD po_key,
[PO Action],
[PO Number],
[PO Line],
[PO Aging],
[PO Buyer],
[PO Item],
[PO Description],
[PO Qty],
[PO Cancel Qty],
[PO Promise Date],
[PO Need Date],
[PO Supplier],
[PO Amount],
if(isnull(tmp_POstatus),'Open',tmp_POstatus) as POstatus,
CounterPO
resident tmp_PO;

drop table tmp_PO;

2 Replies
Not applicable
Author

Do you need a directory command to tell the server where to find _indata\AllAction_thisweek.xls?

Steve

Not applicable
Author

Steve,

Thanks for oyur reply. There's no problem for the app to find the *.xls file. This has worked in the past from the server. I think it has something to do with me using REPLACE LOAD on the same data twice.

Best Regards,
Jonas