Detailed sales generating inaccurate/inconsistent data

Jun 12, 2006 5 Replies

Hi all,



We recently deployed RMS 1.3 in our store. It is running on a Windows



2003 Server with SQL Server 2005.

In looking at our Gross Profit numbers (found by using Show/Hide Column from Detailed Sales), we have have some critical inconsistencies.



For example, for the 9th of June, we show Total Sales of $5064.25 with a cost of $2144.02.



Our gross profit shows $2224.22, with a GP % of 51.65%.



None of these match anything. Sales minus Cost does not equal profit. Profit divided by sales does not equal the GP %. Furthermore, adding gross profit and cost together (to get what the system must be assuming is the actual total sales), then re-calculating GP % gets in the ballpark, but still not what the system is saying.



In other words, there are inconsistencies between four fields: Total Sales, Cost, Gross Profit, and Gross Profit %.



My questions, then, are:


1) Where is this report pulling these numbers from? I have run some queries manually to try and determine this myself, but nothing matches up.


2) Is this a simple re-index issue? Something must be working because our bookkeepers are returning fairly accurate over/short totals ...



Your help is appreciated as always. Looking forward to an answer.


-- Alex Nielsen



Update:

I've done some queries and figured where the numbers are being pulled from. Here is where the inconsistency takes place:

Doing a SUM(Price) on TransactionEntry does not fetch the same results as a SUM(Total) - SUM(SalesTax) on [Transaction].

Any ideas?

-- Alex Nielsen

Check the Report Library on CustomerSource for an updated version which fixes the G/P field.

-- Jason Hunt Advanced Computer Systems

Jason,

Will do. Any ideas on the discrepancy between TransactionEntry and [Transaction]?

-- Alex

I suspect the query is not for a specific TransactionNumber. Try running the two following queries and you will notice they are equal: SELECT SUM(Price) From TransactionEntry WHERE TransactionEntry.TransactionNumber = 'xx'

And.

SELECT SUM(Total) - SUM(SalesTax) From [Transaction] WHERE TransactionNumber = 'xx'

The reason the Active Report Gross Profit column does not work on the Detailed Sales reports when grouping is because groupmethodAverage is not a weighted average of what you sold. The report that is on CustomerSource is a Summary report and therefore won't have the same problem if you change it so there is no grouping after the report has been generated. I would also modify the Detailed Sales report so the profit margin column has no grouping at all.

Rob

I just had an Aha! moment after days of kicking this around in my head. These sorts of problems are always caused by the smallest thing.

The reason my query did not work was because I was only fetching SUM(Price). I should have been fetching SUM(Price * Quantity).

Now, my only concern is how a professional programmer could have made that same mistake when they produced this report. Hopefully that is a rare occurence...

Thanks for all of your help!

-- Alex Nielsen

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required