SSRS - How to create a sum (total) of an expression column? - reporting-services

After plenty of research, it seemd I can't find a well-explained solution to my problem. I'll join some screenshots of my Tablix, group rows, and group columns to help you to understand.
First of all, here's my tablix. It's linked to a SharePoint List.
The expressions are all like this :
=Count(Fields!ID.Value, "NameOfTheGroup")
It counts the number of elements that are filtered by one of the group chosen in the expression, and it works perfectly fine at this point.
Now, here's my groups :
They all contains filters tomanage the count precisely to the need.
What I want to do : In the last row, I want to display the sum of each column that is in a group row. But theses rows aren't datasets fields, they are just only expressions, and I can't find a way to create a proper total of each column. I heard of Running Value but the few solutions I found about it didn't work.
Thanks for the future help.
EDIT: Actually, the problem seems to be much more complex: any rows I create under my group rows are invisible : if I create a new row under the "Classification", outside the "Classification" row group, the expression I insert in the "CDI", "CDD", etc... columns stay blank. I tried with various expression or just values like "Hello World".

Related

SSRS column group displays data on unique rows

I have a data set where i'm using a table to display Name, Radio #, and Unit # information in SSRS tablix. As some of the groups have 60+ members, i thought it would be better to expand the tables into 4 columns repeating those detail fields instead of displaying a 3 page long skinny table. In the SQL i used a row count%4 function to assign a "position" number 0-3 for each name. If i create a table with the detail members above and then add a parent column group on position, i get the tables repeated as i want but each name/radio/unit appears on a unique row. I've tried several different ways of grouping rows/columns but always seem to get this staggered table (with only name/radio to make it easier to digest): sample_pic
Sorry if this is a duplicate. I've really searched quite a bit before putting this in but it's probably the case that if i knew what to search, i wouldn't be putting this question in. So if you'd rather tell me what to search i can do that too. :)
SSRS will display a row in the table for each row returned from the dataset, this is normal behaviour for data to display.
One way to get what you want is to create a query which has all the information form your column headings in one row, probably with a pivot or similar.
Or you could just display your columns in separate tables.

Create an expression based off grouped rows ssrs

I want to create a single rectangle on a report that displays red if there are more then 2 distinct projects being worked on within that week (see image below):
http://imgur.com/dPHW1TT
I'd need to write some kind of expression like IIF(CountDistinct(Fields!Project_Name.Value)> 1, "Red","White") but the issue is that I need the projects to be aggregated per user.
As you can see in the above report I have it grouped on User >> Project, and thats what I'd need to captcher in this single expression.
Is there any way to specify a group in an expression?
I've actually managed to do what I wanted via filtering on the tables group, and then hiding all the cells bar one in the table.
http://imgur.com/G8IKMbS
Although if anyone knows a way to group within an expression I would still be interested in knowing.
Thanks

How, in Reporting Services, can I populate a set of rows in the MIDDLE of a tablix from another dataset?

The setup:
The first few rows after the headers are from fixed aggregate values about the data: Total, Count, Average, that kind of thing. Then, the next ? rows are aggregates populated about individual items in the data...finally, there are more aggregates at the end.
The obvious answer is to create three tablices, but the problem with that is that it's impossible (as far as I can see) to get the tables and borders to line up perfectly so that there is no double-border, or gap, or overall strangeness in the formatting.
How can I do this?
If the number of columns is the same, your first instinct will do it. Use the properties window to make sure your tablix is in the same horizontal location and the column widths are the same.
Otherwise can't you just create a group (with a group header) copy your aggregate queries into the columns?
An example of the dataset and required outcome may help

Interactive sorting in tablix with column and row groupings

I'm trying to define interactive sorting in a tablix. The sorting should affect the row order.
Attaching image of the tablix in order to explain what I'm trying to get:
I already tried to define the column header with interactive sorting and get SubjectParentID to be sorted by expression (the same expression as described bellow). The final setting I made is to apply the sorting to all groups in the tablix -
Attaching image:
The result wasn't current and the data got messed up in the cells.
Additional information: The columns are grouped by SubjectParentID. The rows are grouped by Username as parent and UserID as a child group.
The values are result of the following expression :
=iif(isNothing(Fields!ResReqCertID1.Value),
-99,
Sum(iif(Fields!CertStatusID.Value = 3
Or Fields!CertStatusID.Value = 4
Or Fields!CertStatusID.Value = 5,
1,
0)) - Fields!ResReqCertID1.Value)
In the Text Box Properties / Interactive Sorting window, change the Groups selection to the UserID group (assuming that is the most-detailed group providing the rows in your example).
This can't be done, interactive sorting cannot sort row groups by column values calculated within that group.
If you have 4 static columns you could hard code them. Then having no need for column groups interactive sorting should work as expected.
You could also define a static number, say 10, of dynamic columns, and use pivoting in the thebsql query to get columns 1-10 and their labels. Then set up 10 columns with interactive sorting on the Value_1 fields, and hide them if no data exist for that column. You could then also have an 11th column which also does column grouping but doesn't do sort if there's any chance you'll ever exc3ed the 10 columns.
You could also do this: https://www.c-sharpcorner.com/article/ssrs-interactive-sorting-on-matrix-column-group/ which is somehow even more complicated than my two solutions.
But yeah, you basically can't do this. SSRS cannot be told to sort row groups on values calculated from within the context of the column group that contained the copy of text box in which the sort button was clicked.

MySQL: Use aggregate result in further calculation

I'm currently working on writing report generators. For one report I need to do a breakdown by a given characteristic (supplier, logging user, language, etc which for each row includes the name of the characteristic I'm interested in, the number of items that match that characterastic, and the percentage of total items this figure represents. The first two aren't a problem, the third is.
For example, to get a breakdown by language I'd be using a query like this.
SELECT lang_id,
COUNT(IF(open=TRUE,1,NULL)) AS lang_total
FROM table
GROUP BY lang_id;
This gives me the number of items per language.
I can get the total number of items in the table and store it in a variable simply enough with a plain count.
SELECT #totalOpen:=COUNT(*) FROM table WHERE open = TRUE;
Now I want to add a third column, which is the figure in lang_total divided by the value in #totalOpen multiplied by 100 (in other words, the percentage of all items that fit the criteria). Something along the lines of the following:
This is the bit I'm having trouble with, as because as far as I can tell you can't use aggregate columns in calculations.
SELECT lang_id,
COUNT(IF(open=true,1,NULL)) AS lang_total
(lang_total/#totalOpen)*100 as lang_percent
FROM table
GROUP BY lang_id;
I'm sure that there must be a way of doing this in MySQL, but I've not been able to track it down. Can anyone help out with this?
I read this question now for the first time. I know that probably it's too late to be useful for you but I would have solved in this way.
select lang_id,
sum(if(open= true,1,0)) as lang_total,
coalesce(sum(if(open= true,1,null)) / #r,0) as percentage
from table,(select #r:=count(*) from table where open = TRUE) as t
group by lang_id;