Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

autopilot
Contributor III

Reload Failed after months working

I have a script that has been working as intended for months that started throwing an error as of today which is causing the reload to fail. I have no idea why and there is no documentation on the error type that was provided after debugging and using the error variables to get more clarity.

Can anyone provide insight on this issue?

Script below. Image of error attached.

Product_WarehouseInventory:

Load *,

Company &'/'&Warehouse&'/'&Product as %Inventory,

Date(Today()) as Date;

Select * from database.dbo.Product_Warehouse;

Store Product_WarehouseInventory into DATA\Product_WarehouseInventory.qvd(qvd);

Drop Table Product_WarehouseInventory;

Product_Warehouse_Inventory:

Load *

from

DATA\Product_Warehouse_Inventory.qvd(qvd);

Concatenate

Load *

from

DATA\Product_WarehouseInventory.qvd(qvd);

/* get last date from QVD */

Let varMinDate = num(Peek('Date',-1,'ProductWarehouse_Inventory')) + 1;

Let varMaxDate = Num(Today());

/* get rates from last date to today */

FOR i = varMinDate to varMaxDate

          LET varDate = text(Date(i,'YYYY-MM-DD'));

 

          ProductWarehouse_Inventory:

          LOAD

                     '$(i)' as Date,

                     *;

NEXT

STORE Product_Warehouse_Inventory into DATA\Product_Warehouse_Inventory.qvd (qvd);

DROP TABLE Product_Warehouse_Inventory;

1 Solution

Accepted Solutions
autopilot
Contributor III

Re: Reload Failed after months working

I've identified the problem.

The file being added to incrementally was corrupted or over-written with no data which was the root of the error because it was trying to load nothing and then concatenate to it.

Still would like to have more clarity on a way to lookup these error codes........

5 Replies
mov
Esteemed Contributor III

Re: Reload Failed after months working

It is not a good idea to use "load * from" - you cannot see what is behind this star.  I recommend to replcae it everywhere in your script with the explicit list of fields.  At least you'll be able to see why the load fails.

Regards,

Michael

autopilot
Contributor III

Re: Reload Failed after months working

Michael,

Thanks for your insight. I agree that * can be the source of unneccessary headache at times in hiding what it represents.

In this case, however, I know what the error is....but I don't know what that error means. Unless you are suggesting that by listing all the fields on load will produce a different error, do you have another insight that could help resolve this issue?

Thanks for you help.

mov
Esteemed Contributor III

Re: Reload Failed after months working

Exactly - I hope (no guarantee though) that if you had a more explicit script, there could be a more explicit error message.

autopilot
Contributor III

Re: Reload Failed after months working

I've identified the problem.

The file being added to incrementally was corrupted or over-written with no data which was the root of the error because it was trying to load nothing and then concatenate to it.

Still would like to have more clarity on a way to lookup these error codes........

mov
Esteemed Contributor III

Re: Reload Failed after months working

Good to know, thanks.

As for the errors, you can try using Error variables.  For example, ScriptError returns numbers that can help.  See QV "help" on this.

Regards,

Michael

Community Browser