I'm facing this SSRS issue that I can't seem to get working properly.
I got employees that work on particular projects on specific dates. I want the dates as columns and the projects per date on 1 row.
What I have now:
What I want to have:
Can anyone help me to get there?
Thanks!
Check the row group properties. You only need s single row group and that should only group by employee. My guess is that you group is grouping on more than just employee or you have more than one group.
Your row group should not be grouping by date, only the column group should group by date.
Related
I am working on a report where I have employee time information along with dates for the time. Currently I have the tablix grouped by Employee and Date so that I only get time for that employee and date, however I get a row for each date:
What I am trying to do is drop the Date column and have the time for each Date rollup into it's specific date column (i.e. 7/16/2020 data would rollup into only the 7/16/2020 column header) and only have a single row for each employee. Desired output:
How can I accomplish this?
You Can create a matrix report with Row group and column group. Check below screen shot to get desired output.
Use a Matrix control instead of a table, add a row group by Employee (as you have already) ad then add a column group by date. This will give you the desired results.
I have been searching for an answer to the following but with no success as yet. I am trying to count the number of times a level is achieved by a user within a particular department.
After several attempts I've managed to get results from the query below, however the results are not between the timestamp values required, rather they show the total count for LEVEL. Timestamp is the name of the column in the table, could that be an issue?
SELECT COUNT(LEVEL) AS number, LEVEL, user, department FROM table
WHERE LEVEL ='3' AND TIMESTAMP>= '1500098552' AND TIMESTAMP<= '1568000152'
GROUP BY user ORDER BY number DESC
I have tried using various methods for the WHERE clause including BETWEEN but to no avail.
Any advice would be appreciated, thanks.
Try this one
SELECT COUNT(LEVEL) AS number, LEVEL, user, department FROM table
WHERE LEVEL ='3' AND TIMESTAMP>= 1500098552 AND TIMESTAMP<= 1568000152
GROUP BY user,department,LEVEL ORDER BY number DESC
I'm trying to list multiple columns but specify a condition for only one.. e.g
SELECT max(dollars_spent), customer as most_visits FROM example
I want the customer to display IF they have the most dollars spent but don't know how to specify I want that condition for that specific column only.. I'm tired and am struggling to process this right now. Hoping someone out there will understand what I mean.
This may work...
select sum(dollars_spent), customer as most_visits from example group by customer order by sum(dollars_spent) desc limit 1
in the below image I'm using
SELECT DISTINCT(name),date,reporting,leaving from attendance where date='2016-09-01
and I'm still getting repeating names. Why?
When using DISCTINCT, MySQL uses all columns as grouping factor. If you want group by only one column and get all corresponding column values, use GROUP BY instead
SELECT name, date, reporting, leaving FROM attendance GROUP BY name WHERE ...
Actually your all rows have distinct data apart from Name column if you want only distinct names then you can get it with help of Aggregate functions, you can use MIN or MAX as per your business requirement
SELECT Name,MAX(date),MAX(reporting),MAX(leaving)
FROM attendance
WHERE date='2016-09-01'
GROUP BY Name
Hey guys I'm trying to create a query which sums one column and groups the result by another.
Let me show you what I mean by showing my tables!
This is my tickets table
Expect result
As you can see it groups the column app and issue and then SUMS the time per issue.
Currently I have something like this
SELECT app,issue,sum(time)
FROM tickets
GROUP BY issues
ORDER BY name ASC;
However it's not outputting the expected result. Any help would be appreciated.
You need to also group by app in addition to issues
SELECT app,issue,sum(time)
FROM tickets
GROUP BY app,issue
ORDER BY name ASC;
You only grouped by the issues, don't forget adding the app to the group by also.
This should work for you:
SELECT app,
issue,
Sum(time)
FROM tickets
GROUP BY app,
issues
ORDER BY name ASC;