control column creation when there is data or a relationship in SSRS - reporting-services

Office 1 has person A, Person B and Person C
Office 2 has Person D and Person E
I want to page break by office and display just the persons associated to the specific office.
I have tried row and column groupings and can page break by office, but it still shows every person. The desired output would be as follows:
Office 1 person a person b person c
metric 1
metric 2
etc.
-----------------------------Page Break----------------------------------
Office 2 person d person e
metric 1
metric 2
etc.

Related

The result of the query does not make sense

I am querying a database but the result it gives me is pointless. According to the BD there are 5 different books of which there are a total of 7 copies, from book 1,3 and 5 -> 1 copy of book 2 and 4 there are 2 of each. On loan we have that book 1 and 4 have been Borrowed 2 times, Book 2 has been borrowed 3 times, and Book 5 and 3 have been borrowed 1 time. The query statement is this
From this database, it is intended to create a report with iReport that reflects the loans made for each issue, including its edition, for each title. In addition, for each title the total loans of the copies that exist for said title will be obtained
My query is
Select l.titulo, e.edicion, count(p.idLibro)
from Libros l,
Ejemplares e,
Prestamos p
where l.id = e.idLibro = p.idLibro
nevertheless the result that throws does not make sense, it is:
titulo edicion count(p.idLibro)
Los pilares de la tierra 2010 14
It doesn't make sense if we match the id should all the books come out, not just 1 plus where does 14 count? if book 1 has only been checked out 2 times
this is the link of BD
https://drive.google.com/open?id=1lj0AZFDS4UajTLebL4IwBFw5GspOZl1q

Why would SSRS have 2 instances of a top-level group?

In a report with two levels of grouping, I have a top-level group that is repeating. This is apparent in the report on the left-hand navigation bar/document map but also when exporting to Excel, it splits to two worksheets (with the same name!) and shows on separate lines in the document map tab.
E.g.
UNIT A
person 1
person 2
person 3
UNIT B
person 4
person 5
UNIT B
person 6
The desired behavior is
UNIT A
person 1
person 2
person 3
UNIT B
person 4
person 5
person 6
Any ideas for why the group would be splitting?
SSRS only changes group if there is a difference in value.. ensure there are no hidden characters or the likes in the UNIT B group.

Is mysql database logic suitable for query?

I am designing a database, and I would like to know;
Can I answer this question with queries, how much skill employees earned from this trainings?
Is this a good structure to do it?
how much money spent per department
how much skill earned per employee
how much skill earned per department
id session_name Skill impact sugg dept function training_value training no
1 PHP Software 3 Sales 2 100usd 1
2 PHP Software 3 Finance 2 100usd 1
3 PHP communication 2 Sales 2 100usd 1
4 PHP communication 2 Finance 2 100usd 1
5 ASP Software 4 Sales 2 200usd 2
6 ASP Software 4 Finance 2 200usd 2
7 ASP database 1 Sales 2 200usd 2
8 ASP database 1 Finance 2 200usd 2
attended training table
id student_id training_no
1 1 1
1 1 2
student table
id name department
1 John 1
2 Mary 2
department table
id name
1 sales
2 finance
In the end I need to find skills for each student
john
software 7
communication 2
database 1
total spent
john 300 usd
total spent by department
sales 300 usd
Your schema looks OK to me.
You should, however, think about entities and relationships.
Your entities seem to be trainings, people, and departments.
You have a many:many relationship for people:trainings. That's good.
You have a one:many relationship for departments:people. That's also good.
It looks like you want some kind of relationship for trainings:departments. I'm guessing here, but you have a sugg dept column in your trainings table. Is that supposed to have a direct relationship to your departments table?
Do you actually need an extra entity called "attendance" rather than just a many-to-many relationship people:trainings. Do you want to record when a person did a training? Do you want to record how much that particular attendance cost? How about what marks they received if there was a quiz?
In that case, you'll want relationships where each person has zero or more attendances, each attendance has exactly one training, and each training has zero or more attendances.
My point: do the hard work of thinking through your entities and relationships, and the result will be a good design for your tables.
If I may put it another way: What part of the real world are you trying to capture in your data base? What's valuable in the real world that you want your data base to hold? In your application ...
Students are people. They are, umm, inherently valuable and persistent entities.
Trainings represent the labor and cost of creating them and presenting them.
Attendances represent the effort of students.
Departments probably pay the bill for attendances. They certainly represent power centers in your application.
What other items of value exist in this corner of the real world? Teachers? Managers? Venues (classrooms)? Equipment? Customers?
My point is, figure out your entities -- the items of value -- and the relationships between them. Then write your table definitions.

How to rank data on microsoft access

On Microsoft Access i'd like to create a Rank System in a table based on the time of each participant.
For instance, if person A got 14:20 and person B got 12:40 and person C got 10:10. Person C would get 3 points, Person B would get 2 points and Person A would get 1 point.
Ref:

Which kind of join should i use? [EF4.0 code first ]

i apologize for the bad topic title as i am kinda at lost of what should i do here.
First of all, here are my database table designs and i would like to receive some sort of feedback as well before proceeding:
I am trying to make an enrollment web application.
Subjects
subject
[id] [subj] [professor] [cstart] [cend] [days] [count] [units]
1 comalgo carl 10:00am 12:30pm M-W 40 3.0
2 compasm carl 01:00pm 02:30pm T-TH 40 3.0
3 compro miguel 04:30pm 06:30pm M-W 35 3.0
4 pro5 fua 03:30pm 05:30pm T-TH 30 3.0
5 pro5 fua 06:30pm 08:30pm F 10 3.0
Students
students
[id] [fname] [lname] [bday] [unitsleft] [unitstaken] [major]
1 carlos doe 11/20/1990 100 0 BS-COMPUTER SCIENCE
2 miguel doe 08/15/1992 100 0 BS-ECONOMY
3 carl doe 12/12/1991 100 0 BS-PSYCHOLOGY
4 test doe 02/12/1992 100 0 BS-LITERATURE
What i plan on doing is that, the subjects will be presented through a series of list and the student will pick multiple subjects and enroll. The total enrolled units should not be greater than 20 and less than 11. I already implemented that part and i am now working on storing the selected subjects.
Here is my proposed solution and i would like to receive some feedbacks about it and what operation should i use.
I will have a centralized table for all of enrolled subjects
Enrolled subjects
selected subject
[id] [subjid] [studentid] [status]
1 1 1 P //comalgo enrolled by carlos, P is for pending grade
2 1 2 P //comalgo enrolled by miguel P is for pending grade
3 2 1 P //compasm enrolled by carlos P is for pending grade
What i plan to happen is that: i have a profile page for the students and they will be able to view/edit their currently enrolled subjects specifically for themselves(based from ID)
I want them to be presented with the following table headers which is based from the enrolled subjects:
[subj] [professor] [cstart] [cend] [days]
Here are the brief summary of my questions:
1.) is my table alright? or it's a bad design?
2.) What kind of method should i use? i am trying to research about it(joins) but i am somehow confused and in need of clarification. I want to present the users with their selected subjects.
edit: i think i can do something like.. select where id = x from the enrolled subjects then get the subject id but i am not sure if that will be efficient.
Your tables look good (i.e. third normal form). An INNER join will do
SELECT
B.subj, B.professor, B.cstart, B.cend, B.days
FROM
selectedsubjects A
INNER JOIN subjects B ON A.subjid = B.id
WHERE
A.studentid = 1
p.s. This looks like an assignment for school or something out of a book...?
It could be:
var query = context.EnrolledSubjects
.Include("Subject")
.Where(i => i.StudentId == 1)
.Select(i => new {
i.Subject.Subj,
i.Subject.Professor,
i.Subject.CsStart,
i.Subject.Send,
i.Subject.Days,
i.Status
};