I want to create a report. Grouped by month (from date1) there should be counted how many records match for property1 has value A, B, C, D ... and property2 1, 2 or 3. Additionally there should be grouped by the same month (but this time from date2) property3 has value A, B, C, D ... and property2 1, 2 or 3.
I created two querys that count the amount of matching records for each combination of property1 and 2 (Property3 and 2 respective). But how can I make the result be grouped by the same month in one report?
formatting the date to show month only in both queries. creating a third query, adding the first two, conecting the month-fields, add all the other counting-field, create the form based on the third query.
Related
I have a dataset that I need to arrange into a grid on a page (export to pdfs) as a customer report. Each row in my dataset needs to display as a cell. Each page would have roughly 3 records displayed as columns and then 4 rows of records. e.g. a (3x4 grid), being 12 records per page.
Right now I am using a matrix to display my results, but I cannot find how to get my matrix to start a 2nd row after 3 columns are generated.
Is this feasible or should I find a different solution to create these reports?
I was thinking may be if I had row groups to use, but not sure how to create a column that creates a repeating result 3 times then adds 1 to the next 3 results in my query. 111,222,333,444 and that could be my row grouping?
Here's what I use in a matrix to create a grid of columns from a single cell.
Add a ROW_NUMBER field to the dataset query and subtract 1 with the ORDER BY using the field to be ordered by.
ROW_NUMBER()OVER(ORDER BY DISPLAY_NAME) - 1 AS ROW_NUM
Add Calculated Fields to the dataset using the ROW_NUM.
Call the first COLUMN and MOD row_num by 3 to get values or 0 - 2 for the column number:
=Fields!ROW_NUM.Value MOD 3
Call the second calculated field ROW and get the INT of ROW_NUM divided by 3 to get the row number for the record:
=INT(Fields!ROW_NUM.Value / 3)
Then the matrix would have the Column grouping (and sorting) based on the COLUMN field and the Row grouping on the ROW field.
You could use a parameter as the number of columns (3) to make it easy to change.
I have multiple employee's salary data in tabular format for different months as displayed in the 3rd and 2nd image. (Presently extracted for a single employee in the following images example). There are 35 salary fields/columns for each employee and salary heads are different for different type of job profile. 3rd and 2nd images represent salary data table for all job profile employee. Because the table has many columns so I posted only two part of a single table in third and second images. There are also other fields which have 0 values or more than 0 as per the employee's job profile. I created a query to extract quarterly data for a single employee from the table as per the third and second images.
The first image is the result, which I want to arrange as the stacked format. Presently my report showing only single month data in the this report. There is report load event code to show only heads which have values more than 0 as following:
Dim C As Control
For Each C In Me.Report
If TypeOf C Is TextBox Then
If IsNull(C) Or C = "" Or C = 0 Or C = "0" Then
C.Visible = False
C.Height = 0
Else
C.Visible = True
End If
End If
I want to display the result as per the report images as follows. Is it possible to place 3 stacked column? thanks for the help and any suggestions.
Example images:
You can implement the following SQL query to a salary per employee per quarter considering that your table contains only one-year salaries
SELECT
EmployeeName
,SUM(IIF(Month([DateColumn]) BETWEEN 1 AND 3, Salary, 0)) AS Salary_Q1
,SUM(IIF(Month([DateColumn]) BETWEEN 4 AND 6, Salary, 0)) AS Salary_Q2
,SUM(IIF(Month([DateColumn]) BETWEEN 7 AND 9, Salary, 0)) AS Salary_Q3
,SUM(IIF(Month([DateColumn]) BETWEEN 10 AND 12, Salary, 0)) AS Salary_Q4
FROM TblSalary
GROUP BY EmployeeName
I'm creating a SSRS-report where I need to group my values and do another grouping based on the grouped values. Then I also want to limit the records on each row.
Now my table look like this (but with maybe 50 values):
A
A
A
B
C
C
D
E
E
F
(ignore the bullets, it was the only way to get the values vertical)
I want my table to fit in one page and become horizontal and be grouped.
The result I'm after look like this:
A, B, C,
D, E, F
I writing this in MDX because I need to have data direct from the cube.
I would have a great solution if i didn't have to group the values together.
It's was to use the ceiling-function (ceiling(rownumber(nothing) mod 6)) in ColumnGroup and (=ceiling(rownumber(nothing) / 6)) in RowGroup.
Has someone a solution, maybe a nested expression to both group the values and then do the ceiling trick?
Perhaps you can add a calculated field to the dataset, GroupID, with a value based on the position in the alphabet and your paging requirement.
For example :
Letter GroupID
A-F 1
G-L 2
M-Q 3
Next you can group similar to below.
Column Group 1 Expression = GroupID
Column Group 2 Expression = Letter
You may wish to place a page break after group for Group1 to force repeats on a new page.
How do I group/filter rows and then get total rows for each column. I am going to diagram what the result should be. I don't want to show the actual data. Just the count per column
Out Put should look like this
Column A Column B Column C
Row A - 235 records 300 records 15 records
Row B - 1 record 80 records 900 records
Each column represent a count on the same field but filtered.
So ..
Column A is really Count(MyColumn) WHERE = A
Column B is really Count(MyColumn) WHERE = B
To summarize each row is a grouping + filter and each column is a count based on the number of rows contained in that grouping. No row data needs to be displayed.
You can do this in a table in the group by using the following formula:
=SUM(IIF(Fields!MyColumn.Value = "A", 1, 0))
However, this type of summary report is what a matrix is designed to do. Use the Row field as the row group, the column field as the column group and a Count expression in the intersection and it will do it all for you.
I have a tablix which has a group A, B, C.
The dataset has values for A, values for B, and values for C.
Inside I have a grouping with details.
So:
A
v1 1
v2 2
sub 3
B
v3 3
sub 3
C
v4 4
v5 5
sub 9
sub is the subtotals of the details in the group.
How can I grab the sets of details from A and add them to B, but not C?
Before I did an if statement and used "Running Total", which helped for numbers and summing, but what about details, such as strings?
Otherwise, all the data is in the dataset. If you're nested in a grouping, is there still a way to get all the data of a dataset and ignore the group on?
Thanks for any help!