Hi all,
I'm pretty new to Access but have recently tried to get into it, because I want to build a small database to track sales data and sales target achievements.
I have two tables with values that I want to compare: one with sales targets (per month, per product, per customer), and one with sales data (products purchased per order and revenue gained from this). I am now trying to make a query to have the targets per month, per product, per customer, and the revenue per month, per product, per customer side by side and calculate the target achievement percentage by dividing the two. To do this I added the columns for 'month', 'customer', 'product' and 'sales target' from the sales target table, and a sum aggregate for 'sales revenue' from the orders column. I ran the query and it seemed to do the trick, but then I noticed a problem:
There are instances where no target is set for a certain customer/product/month, but the customer did buy this product. Conversely, there are instances where there was a target, but no sales. What happens with my query is that it only shows results in which there was both a target and there were sales, and it leaves out any row where either is missing. I would like to have my query also to show these however, preferably with a 0 in the column for which there is no data. I have tried to solve this problem by creating 'dummy' data in my budget table (i.e. add a row for every month, every customer and every product, and giving it a value 0 if there is no budget). However, this only partially solved the problem - now it will indeed show instances where there were sales but the budget is 0, but still not the other way around, and the dummy data makes the file much heavier.
I realise my description of the problem may not be terribly clear, so I've attached a screenshot of the query for reference. If anyone has any ideas, I'd be more than happy to hear about them.
Thanks!