Very simple SQL report question - adding a total to a column
Hi There
You just need to create a report and add a table to it and then add your category column and count column into the table
Right click on the detail group and add total to it you have done I am putting screenshot for your help
If you have any questions please do ask.
Many Thanks
Syed Qazafi Anjum
Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
May 23rd, 2012 7:23pm
Hi,
Total SQL n00b here, please be gentle.
I'm generating simple reports using SQL in Spiceworks, ostensibly to show how many helpdesk tickets have been opened/closed in a week/month, per category.
The resultant reports lists two columns, the left column shows each helpdesk category, the right column shows the number of tickets for that category.
Is there a way to show the TOTAL number of tickets for all categories at the bottom of the right column? Here's an example of my code for one of these reports:
SELECT category, count(*)
FROM tickets where (created_at>=date('now','-7 days'))group
by category
order by count(*)
desc
Any assistance very gratefully accepted!
Free Windows Admin Tool Kit Click here and download it now
May 26th, 2012 6:37pm
Hi Ali,
As your question mentions that you have two DataSets.
#1- Which is querying the tickets anc categories data
#2- Which you want to do, showing total.
As you are being restricted by the BIDS (Business Intelligence Development Studio) to show the total below the #1 Table/Matrix (Tablix), and the reason is because that in the #1 table/matrix you can only pull data from one dataset.
Here is what you have to do.
1- In the Design view, right-click below the table (for dataset #1)--> Insert--> Matrix.
it will insert two column sand two rows by default.
2- Place this just below the Table you alredy have the right-side border of both the tables now should be in alignment.
3- I think you will already have a DataSet created for your Total calculation query in a separate DataSet, if not create one.
4- Now Drag your Total column to the newly added table, and test in Preview.
5 In the newly added Table, individually select the column #1 and Rows below to remove, so it leaves only one single cell below it.
Hope this will get you very close to what you were looking and you will be able to tweak it further if required.
Hope this will help.
Vidya Vrat Agarwal. http://dotnetpassion.blogspot,com
May 26th, 2012 7:16pm
Hi There
You just need to create a report and add a table to it and then add your category column and count column into the table
Right click on the detail group and add total to it you have done I am putting screenshot for your help
If you have any questions please do ask.
Many Thanks
Syed Qazafi Anjum
Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
Free Windows Admin Tool Kit Click here and download it now
May 26th, 2012 7:32pm