Hi - Currently I'm manipulating product sales data that exists in a regular database table into one where each product sale is shown in a separate column for each product group. This query is then linked to excel so that other people can carry out further calculations on the data in a way that they're used to and with data from outside the database.
Product sales table fields are:
company (A,B,C) etc
Product code (1,2,3) etc
sales numbers
e.g.
Company A, Product 1, 10 sales,
Company A, Product 2, 20 sales
Company B, Product 1, 15 sales
That needs to be in form:
Company A, 10 product 1 sales, 20 product 2 sales,
Company B, 15 product 1 sales, 30 product 2 sales
etc.
I could easily pivot table this out, but in order to get excel's index(match) to work easily on this I'm using a query per product group that is being joined to a master list of companies. I've experimented with aliasing the sales table multiple times, so that I can do all this work in one query, using different "where" criteria for each aliased table. However, I can't get this to work, as it's either only showing data where product sales are non null across all selected product groups, or showing multiple rows of data depending on the join type.
Apart from the logic of the exercise I'm doing (?!) is it possible to alias tables to get them to work in the way I want?
thanks