Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script problem or ??

I am using the following code to add the latest 7 days of records (the "delta" table) to the main table. The tables are SAP tables that we are extracting with the SAP Connector. All was working, but now totals seem to be doubling up when I use the "sum" . For example, I select only one record and the total sales for the item is $10.00, but if I sum the field I get $20.00 even though only one record is selected. Any ideas what is happening?

Thanks,
Stephen





VBRP:



LOAD

DISTINCT * FROM Q:\Folder\VBRP_USA.QVD (QVD);



LOAD

DISTINCT * FROM Q:\Folder\VBRP_USA_DELTA.QVD (QVD);



store

* from VBRP into Q:\Folder\VBRP_USA.QVD;



DROP

TABLE VBRP;



2 Replies
Not applicable
Author

Hi,

this this sounds like you wanted to use the CONCATENATE LOAD?

Best regards
Stefan

Anonymous
Not applicable
Author

Hello Stephen,

I think that you might have loaded your data twice so that you have two records with $10 each. If some of the records in VBRP_USA_DELTA.QVD are already loaded into VBRP_USA.QVD you'd want to employ some kind of check to make sure that you only load the new rows that are not in the base QVD already. This can be done using either Exists() if you have unique id's for matching. Another common approach is to set a timestamp variable every time the reload is done and use this to only load rows where the rows' timestamp is greater than the variable.

If this is the case there should be more information under Incremental reload in the reference manual with code examples.