james.crust
New member
- Local time
- Today, 05:57
- Joined
- Nov 6, 2019
- Messages
- 5
Hi, new poster here, apologies if I haven't got the right forum - please let me know if I need to post elsewhere. The last 2 images are Excel drafts to try and show what I am trying to achieve.
I have a screening assessment database, simple enough so far: Clients table (ClientID PK), Dsqiid table with ClientID as FK (Dsqiid is the assessment), Scores table with DsqiidID as PK for 1 to 1 relationship. Each client can have many Dsqiid assessments. Each Dsqiid can have one Scores record.
This is a section of the actual scoring part of the form just for context:
There are 43 answers in the Scores table (S1, S2, S3 etc.) Each question can have one of 4 answers stored, as shown above. I have used an option group for each question to assign a value of 1 to 4 for each question. I figured I can look up the text equivalent for the 4 answers from another table. Here's what it looks like:
Now I am stumped on how to aggregate the data to show me: "Show me the percentage of each answer (1 to 4), for each question, aggregated from the DSQIIDs selected (eventually I will have a date period to select from). I was hoping to get something like this (again I figured I could alias/lookup the actual question in place of S1, S2 etc.):
From this I should be able to column chart to get this. This is what I am looking to achieve:
I have been tinkering with UNION queries and trying different aggregate queries, but I feel my head is just not getting round this, or that I am storing the data incorrectly in the first instance and I am doing something fundamentally wrong.
Any help or advice to point me in the right direction would be appreciated.
Many thanks
James
I have a screening assessment database, simple enough so far: Clients table (ClientID PK), Dsqiid table with ClientID as FK (Dsqiid is the assessment), Scores table with DsqiidID as PK for 1 to 1 relationship. Each client can have many Dsqiid assessments. Each Dsqiid can have one Scores record.
This is a section of the actual scoring part of the form just for context:
There are 43 answers in the Scores table (S1, S2, S3 etc.) Each question can have one of 4 answers stored, as shown above. I have used an option group for each question to assign a value of 1 to 4 for each question. I figured I can look up the text equivalent for the 4 answers from another table. Here's what it looks like:
Now I am stumped on how to aggregate the data to show me: "Show me the percentage of each answer (1 to 4), for each question, aggregated from the DSQIIDs selected (eventually I will have a date period to select from). I was hoping to get something like this (again I figured I could alias/lookup the actual question in place of S1, S2 etc.):
From this I should be able to column chart to get this. This is what I am looking to achieve:
I have been tinkering with UNION queries and trying different aggregate queries, but I feel my head is just not getting round this, or that I am storing the data incorrectly in the first instance and I am doing something fundamentally wrong.
Any help or advice to point me in the right direction would be appreciated.
Many thanks
James