Create a matrix from 3 tables - ms-access

I have a project table which lists every project. I have a cost center table which lists every cost center. I have an analyst table which shows the project, the cost center, and the analyst assigned to them. The projects and cost centers are dropdowns lists. Every project should have every cost center included in it. For every project and cost center combination, there should be an analyst assigned to it. How do I see which ones I have missed? The query I keep trying has two outer joins and Access doesn't like that. With 30 projects and 15 cost centers it is easy to forget to assign an analyst to one of the combinations.
It would also be helpful to have some kind of query that easily shows who is assigned to what projects, preferably in a crosstab format (similar to a pivot table). I think I can do that if I have the corect query that links these 3 tables together and shows every project with every cost center and which analyst is assigned to them.
If my setup with 3 tables is the main problem I can redo the database design. I thought I was designing it correctly by having a seperate table for projects and cost centers and a 3rd table that combines them with the analysts. But now that I can't figure out how to get this query to work I am thinking maybe that wasn't the best design idea.

Sorry. I figured it out. I guess writing the question helped me think it through.
I used one query that had the project table and the cost center table in it. This created a list of every possible combination.
I then made a second query that linked the first query to the analyst table. I forced the query to show every combination from the first query and then tell me when an analyst matched that combination. This way I get blanks for every time I missed adding an analyst. It was also very easy to turn this 2nd query into a pivot table that shows all of the blanks.
Sorry again for posting this question.

Related

SSRS (MS Report Builder) - How do I add multiple lines of queried details to a single row of otherwise more general info?

I've been trying to figure this out, but I'm struggling.
Working in Microsoft Report Builder (latest version), I have a table that, for the most part, contains general information from a specific table, which I'll call GeneralInfo. In that table, each person has only a single row containing information about that person. However, one of my columns has a one-to-many relationship with the rest of the row. I'll call this other column DetailInfo.
This table provides an example of the kind of thing I'm going for:
In this example, all of the white cells come from the GeneralInfo table. The Orange cell may include many rows of work history, and each entry includes multiple elements from the DetailInfo table, separated by Newlines. The two tables can be matched / joined on the ID value.
This may not be the best way to go about a report, but it's part of the spec I was given. I know this can be done, but I'm having trouble learning how. Can anyone help me out?
Edit - I just found out that another column is also potentially one-to-many. In the example table, it would be saying that the "Occupation" value comes from the DetailInfo table, rather than the GeneralInfo table.
In MOST circumstances, this would just be "Construction Foreman" over and over again, and we would only want to show that once. However, in rare circumstances, an individual may have multiple concurrent (differing) Occupation values that would have to be shown. Is that possible? Should I make that a separate question?
I took Soundappan A's advice and created a sub-report in the column that needed the extra data. This video was helpful to me in learning how to set that up:
https://www.youtube.com/watch?v=LhSitVAnhyc

How to create a query that is able to sort data into 2 groups?

so I'm very new to Access - just started learning it this week. I have data comprised of a bunch of policy numbers with corresponding ratings and premium values.
What I'm trying to do is create a query table that aggregates this data by rating (=1 or >1), this is the part I can't figure out. In design mode, I have put criteria =1 or >1, but it's not doing anything; when I switch to datasheet view, it just lists all of the ratings instead of two boxes that say =1 and >1. If anyone could give me insight on how to do this, I'd appreciate it!
From what I understand after reading your question, you want a query that shows two columns, one that counts the records with a rating of 1 and one that counts the records with a rating of greater than 1.
The best way to do this is to set up two expression columns, both wrapped in a count as you can see below:
SELECT Count(IIf([Rating]=1,[Rating],Null)) AS [=1], Count(IIf([Rating]>1,[Rating],Null)) AS [>1]
FROM tblSortRating;
If you have any questions or I've misunderstood your question leave a comment and I'll get back to you.

Report builder 3.0 Using Reportitems!TexboxXX.Value sometimes creates multiple boxes. Why?

I have 6 Datasets each one is the same query but has a different WHERE clause based on employee type. They generate 6 tables. At the top of the report there is a summary table which uses reportitems!textboxXX.value to grab the totals for 2 particular fields from all the tables. I'm also using a StartDate and EndDate parameter. Each reportitems! expression in the table comes from a different dataset in the report if that is relevant.
When I run the report using dates from yesterday back to the 9th of May I get the desired output.
But when I go to the 8th I get multiple rows all the same.
and as I go even further back I get even more rows of the same information. To my knowledge nothing interesting or different happened on the 8th of May and the tables further down the report look exactly the same. Any idea what might be causing this? The design view looks like this if that helps. There's no grouping or filters on the table.
Still not certain about the mechanics behind this but I found a 'solution' so I figured I'd post it. I just made a new dataset for my summary tables where the query was simply SELECT 1. Now I get a single row every time.

Access Query: Average per Entry

Here's a little background on what I'm trying to do.
[All_Distributors] is a list of products and product info.
[Brand_Volume_Conversion] is a list of products Ive measured and weighed for shipping purposes, which allowed me to calculate a Volume per lb for each item. I would like to use this volume per lb measurement to help me predict the volume of a product based on Brand and similar weighted items.
This is what I have so far (image) but Im getting Duplicate entries per given Part Number and its taking forever to do so. Im kind of stuck at this point, I thought someone else might have a better way of doing this or have some suggestions for a newby. Thanks for the help.
Ive made a little head way since I asked this question. I have now got the results Im after, however its still very slow. Between the 500,000 records in [All_Distributors] and another 7,000 [Brand_Volume_Conversion] it creeps and unusable. Anyone have any suggestions? Second picture is of working but slow code.
I would stick with your first version of the query, but with the following changes:
Use Brand as the related column between the two tables (i.e. the line)
Make it a "Totals" query but clicking the sigma in the ribbon at the top
Set the "Total" property for your Distributer+Partnum,Brand and Weight columns in the grid to "Group By"
Add your "Distributor_Weight" column to the query grid; set its "Total" property to "Where"
Set this new entry's "Criteria" property to ">=[Weight]*.9 And <=[Weight]*1.1"
Change your Vol/lb to "Vol/lb: [Volume per lb]" and set its "Total" property to "Average"
The idea here is to avoid using the sub-query in your calculation. That's what's really slowing things down. Also, I'm a little confused your multiplying by -1 twice and am assuming that matching on Brand is what you want.

mysql adjust value temporarily. Is this possible?

I have a module on my website which lists products by their popularity and the list changes quite regularly. I'd like to automatically discount the top 3 popular products, this is easily done through changing the discount column to 5 for the 3rd product 10 for the 2nd and 15 for the top. However, as the list is regularly changing I need this discount id to revert back to whatever it was before it was overwritten with the new discount id.
Would I have to create another column and call it something like old_discount and transfer the old discount to that before changing the new one and then have it copy it back when it is not longer in the top 3?
I'm hoping someone has an easier way this might be done, any help at all would be appreciated. Thanks for your time.
There's probably no way to get around adding something to manage the top three discounts. As far as actual implementation, there's a couple of ways you could do this that come to mind:
Create a table just to store the current list of top 3 products (or a one-row table with three fields for the top three). Refresh this table with the top 3 when you automatically check. Then in your code that calculates prices, reference this table first to see what is being discounted before doing the rest of the calculation.
If you are going to add a column to the table, I would add a temp_discount instead of old_discount so you can always leave the original alone. Then your code should check if temp_discount is set, use that, otherwise use the normal discount column. Then you simply set temp_discount to 0 before setting the next top 3 products every time you want to refresh.