SSRS 2008 R2 - COUNTDISTINCT By Group
Hello,
Thanks for the help in advance. I have some a results set that gives some numbers by country. The countries selected are controlled by a parameter which is 'Multi Select'. There could be one or many countries selected.
My 'Detail' level dataset is fine, however I'd like to add a summarised DISTINCT count of numbers by country in another location on the report. I'd like SSRS to do the summary (based on the detail rows it already has), rather executing another SQL query
to the database for the summary.
If there were a small list of countries I could do a COUNTDISTINCT IF Group = XYZ. However as there could be a few or many, this is not practical.
This is what the detail looks like:
Here is an example of how I'd like to summary to look like (without doing a separate SQL query):
Many Thanks,
UnoT
Hi UnoT,
Per my understanding you want to count the number of the same country based on the Country field, right?
I have tested on my local enviroment and we can use the count() function to do this,detial information below for your reference:
I use the sameple data as below and count of the Year:
Create an row group(Year1)based on the Year and select the entire column of the year to Insert an Inside Group-Right.
Use below expression to count of the year:
=Count(Fields!Year.Value,"Year1")
Preview the result like below(If you don't want to display the Details(Amount), you can hide the entire column):
If you have an unique field(Amount) you can also add this field in the details group(e.g Amount in above table) and using expression as below:
=CountDistinct(Fields!Amount.Value, "Year1")
If you still have any problem, please feel feel to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support
Similar Messages
-
Calculate percentage between two rows in a matrix report with a single row group in SSRS 2008
I need your help. I have a matrix report in ssrs 2008. The report contain one field value column and one value column. I need to calculate a percentage for two values. For example : row 1 : Discount 10 Row 2 : Sales 100 Result : 10/100. I have only one
row group, I need to have a condition where Field = Discount % on Revenue then Discount/Total Turnover. Because of the grouping for total, I am not being able to calculate the %, its just totalling the % discount. Kindly refer to the snapshot of the
report.Hi Thanks a lot for your answer, but unfortunately it didn't work,the report is reading from a stored procedure which I have unpivot to convert all columns into rows, so that's why Discount % on Revenue, Discount and Total Turnover is found in one column.
So the Field!Col.Value is the Discount % on Revenue, Discount and Total Turnover. I have tried to change the code to
"=SUM(IIF(Fields!Col.Value = "Discount",Fields!value.Value),0))
/IIF(SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)) = 0 ,
Nothing,SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)))" but to no avail. Any other suggestion will be most welcome.
Thanks.
If everything you're getting from stored procedure then you need to calculate and bring the value from there itself.
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
SSRS 2008 Matrix grouping help
Hi. I have a requirement to create an SSRS report with a tablix or matrix which looks like the image below. My dataset will hold the following column values: Project name, overall rag, cost rag, scope rag, headline and commentary.
The RAG values are all colours which I will represent via a background expression. The grey columns will be static.
The headline and commentary values are long text values and should run under the RAG columns as depicted.
I have no idea how to group and create this in an SSRS 2008 report; please can someone let me know how I should configure this?We can merge cells in Data Region of tablix. Refer this link
http://technet.microsoft.com/en-us/library/dd207131.aspx
Moreover it is important that we know how the data looks like in Data Set. Post the sample data.
Regards, RSingh -
How to make a summary column appear only once (in the first page only) in SSRS 2008?
Hello Everyone,
How to make a summary column appear only once (in the first page only) in SSRS 2008?
Regards
Gautam S
RegardsHi,
Assuming you have test data like this ;
select 'abc'as [GROUP],'NN' name , 1 id
union all
select 'abc' as [GROUP] ,'PP' name , 1 id
union all
select 'abc'as [GROUP],'RR' name , 2 id
Step1 : take Tablix with row group as your group Name .
Step2 : right Click on Row Group Details -> Delete-> Delete Group Only
Step3 : In Count Cell use below expression ;
=CountDistinct(Fields!id.Value)
Follow this link;
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b6b45917-0a26-4d15-be46-2c6a2697d6e9/distinct-rows-sum?forum=sqlreportingservices#5ffdee06-c2c8-44ea-a3a5-b958488bb6b5
Thanks
Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com -
Issues passing drillthrough parameters from a multi-level tablix in SSRS 2008 R2
Hello,
I am really struggling with trying creating a drillthrough report that starts with a matrix (tablix) and passing those parameters. I am using SSRS 2008 R2.
Here's my scenario:
I have a matrix that has mulitple levels where you can drill down. Here an example with all the levels open:
Active
Term
Leave
Total
128
88
121
United States
110
80
85
New York
65
30
57
Manhattan
10
6
9
Buffalo
20
23
4
Albany
35
1
44
Texas
45
50
28
Dallas
40
30
22
Houston
5
20
6
France
18
8
36
Centre
18
8
36
Blois
7
2
8
Druex
6
1
15
Tours
5
5
13
I want to drillthrough to another report - Detail Report. As I understand it, I would click the 65 for New York and I would see the detail for the 65 Active people. If I click the 2 under Blois, I would see the 2 terminated people in Blois. My understanding
for this to work, the Detail Report would need a a parameter for each of the level possibilities in the matrix that I could click: Country, State, City as well as the Status (Active, Term, Leave).
While I understand about passing parameters, what I don't understand is how to pass the parameters if they are blank. Let's say I clicked 65 for New York, I would need to pass State = New York Status = Active. But the remaining parameters (Country
and City would be null). I know Country doesn't need to be Null in this case.
My Detail Report has the parameters defaulted to Null, but whether I put the parameters in a Filter for the dataset or in the query itself, I cannot get it to ignore the Nulls.
As a crazy work-around (I think) I can put in the Where of the query something along the lines of: this:
and (a.Country in (@paramCountryCode) or NULL in (@paramCountryCode) )
and I would need to do that for each parameter. Usually I have to use 'ALL' instead of NULL, I'm note sure why.
Additionally, in the Report Action of the Main Report, I need to pass those parameters for each level and their Status. I am also not clear whether or not I need to put in all the parameters on each of the levels (Country, State, City) of the matrix. And if
I do, do I need to make the expressions an IIF statement stating whether or not they are In Scope?
All the examples I was able to find, only showed one or maybe two parameters being passed. Doing the way I am trying, seems convoluted, error-prone and tedious. I really hope that I am wrong.
Is there a better way to approach drilltrough reports from a matrix when there are multiple levels?
Thank you for the help.
~JHi Jenna_Fire,
According to your description, you have a matrix contains total for each group on each level. Now your requirement is, when you click on any number (data field or total), it will go to the detail report which returns all the detail information of the people
within the group scope. For example, if you click on the total of Active users in United States, it will return the detail information of Active users in New York and Texas. Right?
In this scenario, we should set the parameter (@Country, @State, @City) allow multiple values in both main and detail report. And in Default Value (@Country, @State, @City), query out all distinct values. In the textbox which contains
those total values, when set use these parameters to run the report, we only need to pass the parameters of parent groups. For example, if we click on the total of Active users in New York, we only need to pass Country, State, Status to detail report, and
in the detail report, the City parameter will use all distinct values (Default Values) because we don't pass the City parameter. We have tested this case with sample data in our local environment. Here are steps and screenshots for your reference:
1. Create parameter Country, State, City and Status in both main report and detail report. Set both Available Value and Default Value get values from query (Create a dataset for each parameter, use "select distinct [column] from [table]" as query). Set allow
multiple values for parameter Country, State and City in both reports.
2. In corresponding textbox, pass appropriate parameters in go to report Action.
4. Filter data in detail report (in where clause or using filters).
5. Save and preview. It looks like below:
Reference:
Using Parameters to Connect to Other Reports
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
SSRS 2008 Production orders created report, when I added item description some how cost group id is not working ,
my costgroup id did not break into labor , only Mat Cost showed in the total,
my query is as below, did I link the wrong field, I want to show Labor total also
can some one suggest what I did wrong .
any advise will be great
SELECT PRODTABLE.PRODID, PRODCALCTRANS.COSTGROUPID, PRODTABLE.QTYCALC, PRODTABLE.PRODSTATUS, PRODCALCTRANS.COSTAMOUNT,
PRODCALCTRANS.COSTMARKUP, PRODCALCTRANS.REALCOSTAMOUNT, PRODCALCTRANS.CALCTYPE, PRODTABLE.DATAAREAID, PRODCALCTRANS.KEY3,
PRODCALCTRANS.CONSUMPVARIABLE, PRODCALCTRANS.REALCONSUMP, PRODTABLE.ITEMID, PRODTABLE.SCHEDDATE, PRODTABLE.FINISHEDDATE,
PRODCALCTRANS.KEY1, PRODCALCTRANS.TRANSDATE, PRODCALCTRANS.QTY, PRODCALCTRANS.KEY2, PRODCALCTRANS.COLLECTREFLEVEL,
PRODCALCTRANS.LINENUM, INVENTTABLE.ITEMNAME, INVENTTABLE.ITEMID AS Expr1, PRODTABLE.INVENTTRANSID
FROM PRODTABLE INNER JOIN
PRODCALCTRANS ON PRODTABLE.PRODID = PRODCALCTRANS.PRODID AND PRODTABLE.DATAAREAID = PRODCALCTRANS.DATAAREAID INNER
JOIN
INVENTTABLE ON PRODCALCTRANS.DATAAREAID = INVENTTABLE.DATAAREAID AND PRODCALCTRANS.KEY1 = INVENTTABLE.ITEMID
WHERE (PRODTABLE.PRODSTATUS = 7) AND (PRODTABLE.DATAAREAID = N'AR1') AND (PRODTABLE.ITEMID = @itemid) AND
(PRODTABLE.FINISHEDDATE >= @Paramfromdate) AND (PRODTABLE.FINISHEDDATE <= @Paramtodate) AND (PRODCALCTRANS.COLLECTREFLEVEL
= 1) AND
(PRODCALCTRANS.CALCTYPE >= 0)Hi Bitia,
As per my understanding, after you add Item field to the report, it does not calculate total of matl group, right? If that is the case, please refer to the following steps to troubleshoot the problem:
Modify the dataset used to retrieve data, delete the fields will not be used in the report.
Run the query in SQL Server Management Studio (SSMS) to make sure that there is data for matl cost group.
Make sure that row group and totals are correctly added.
In addition, do you want to add Finished date to page header? If that is the case, we can use ReportItem to achieve the goal. Please refer to the following steps:
In design surface, right-click the report and click Insert, then click Page Header.
Drag Text Box from Toolbox to page header.
Right-click inside of Text Box, then click Expression.
In the expression text box, type the code like below:
=ReportItems!FinishedDate.Value
If the problem remain unresolved, please provide the screenshot of the report in design view, the following screenshot is for your reference:
Reference:
ReportItems Collection References
Adding Grouping and Totals
Thanks,
Wendy Fu -
SSRS 2008 - hide chart lines based on parameter selected
How to control visibility of chart lines based on Params selected by user?
By default, my report display last 3 years worth of data (including current) with Month on the x axis and Counts on the y axis. I have two Boolean parameters:
TwoYrs? T/F
ThreeYrs? T/F
if False is selected for TwoYr and ThreeYr parameters then I want to hide chart lines corresponding to last year and the year before.
What I've tried: Created 3 Series groups with filters. eg. YearSeries1 to return only current year data and applying an expression to display it if params TwoYrs and ThreeYrs = False. and so on for YearSeries2 to return current + last
years data if param TwoYrs is True and ThreeYrs = False. But I don't see where to add expression to control the display of the individual series groups. I am open to any way of doing this, but this seemed most logical.Hi Ok-Hee,
In your Source Query just need to filter the series data based on the Parameters.
I have written sample query below:-
select * from
select 1 monthnumber , 'Jan' MonthName, 2013 year,100 amount
union
select 1 monthnumber , 'Jan' MonthName, 2014 year ,200 amount
union
select 1 monthnumber , 'Jan' MonthName, 2015 year , 300 amount
union
select 2 monthnumber , 'Feb' MonthName, 2013 year, 300 amount
union
select 2 monthnumber , 'Feb' MonthName, 2014 year, 350 amount
union
select 2 monthnumber , 'Feb' MonthName, 2015 year,200 amount
union
select 3 monthnumber , 'Mar' MonthName, 2013 year, 380 amount
union
select 3 monthnumber , 'Mar' MonthName, 2014 year, 100 amount
union
select 3 monthnumber , 'Mar' MonthName, 2015 year, 500 amount
)t
where year in (
select distinct FilterYear from
select case when @TwoYrs=1 then year(getdate())-1 else year(getdate()) end FilterYear
union
select case when @TwoYrs=1 and @ThreeYrs =1 then year(getdate())-2 else year(getdate()) end FilterYear
union
select year(getdate()) FilterYear
) t
I have created one post in my blog , you can check the result.
https://msbitips.wordpress.com/2015/03/12/ssrs-2008-hide-chart-lines-based-on-parameter-selected/
Thanks
Prasad -
How to calculate difference and percentage in matrix report dynamic columns in SSRS 2008
Hi Friends,
I need to calculate Difference and Percentage In matrix report SSRS 2008
1) Row grouping based On Product
2) Column Grouping Week and Fiscal Year Current week and Previous Year same Weeks
3)Data Invnetory(Value fileld)
Example:
If value1 and Value2 Available we need to calculate Percentage and Difference.Otherwise Not required NA I need to Show.
For example If Particular week,Current year data is available,Previous year week data is not available No
need to cal Diff and Percentage we need to show Empty.
Below Code is working for If two values is available.
If any one of the fiscal year week data is not there it's taking some garbage values.
I tries with If condition in GetPCT() and GetDiff() It's not working.
Can some one please help me on this.
I am using the custom code
Public Shared Value1 as String
Public Shared Value2 as String
Public Shared previous as string
Public Shared previousweek as string
Public Shared Function GetValue(Value as String,partner as String,Week as String) as String
If partner =previous and Week =previousweek Then
Value2=Value
Else
previous=partner
previousweek=Week
Value1=Value
End If
return Value
End Function
Public Shared Function GetDiff()
return Value2-Value1
End Function
Public Shared Function GetPct()
return (Value2-Value1)/Value1
End Function
How to handle this.
Thank You, Manasa.VHi veerapaneni,
According to your description, if one of the fiscal year week doesn’t have data, the custom code returns false results.
For your requirement, if NULL value exists in the database, we should replace it as zero then perform calculate. So within the code, we should judge whether the value is NULL. To achieve your goal, please refer to the steps below:
1. Create a table like below.
create table dif4
([Product Group] varchar(50),
[Week] varchar(50),
[Fiscalyearweek] varchar(50),
value int
insert into dif4 values
('Desktops','W01','FY14W01',0),
('Desktops','W01','FY15W01',45),
('Desktops','W02','FY14W02',null),
('Desktops','W02','FY15W02',30),
('Desktops','W03','FY14W03',12),
('Desktops','W03','FY15W03',50),
('Notebooks','W01','FY14W01',35),
('Notebooks','W01','FY15W01',56),
('Notebooks','W02','FY14W02',45),
('Notebooks','W02','FY15W02',87),
('Notebooks','W03','FY14W03',75),
('Notebooks','W03','FY15W03',105),
('Tablets','W01','FY14W01',34),
('Tablets','W01','FY15W01',46),
('Tablets','W02','FY14W02',49),
('Tablets','W02','FY15W02',96),
('Tablets','W03','FY14W03',42),
('Tablets','W03','FY15W03',113)
2. Add the custom code in the Report Properties.
Public Shared Value1 as Integer
Public Shared Value2 as Integer
Public Shared previous as string
Public Shared previousweek as string
Public Shared Function GetValue(Value as Integer,product as String,Week as String) as Integer
If Value=Nothing Then
Value=0
End If
If product =previous and Week =previousweek Then
Value2=Value
Else
previous=product
previousweek=Week
Value1=Value
End If
return Value
End Function
Public Shared Function GetPct()
If Value1=0 Then
return 0
Else
return (Value2-Value1)/Value1
End If
End Function
Public Shared Function GetDiff()
return Value2-Value1
End Function
3. Design the matrix like below.
4. Then get the expected results.<o:p></o:p>
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
Hi,
I am using SSRS 2008 R2.
I have two TABLIX in a report. One is TABLIX with row/clumn grouping. 2nd one is flat view.
Here each tablix is dispaly it's data on single page for each.
My Requirement on First TABLIX is:
1. I have to make column headers visible on scrolling down
2. Export to PDF - column headers must be visible on all the pdf pages for same tablix data.
But ... either one is achieved at my end.
so ... any suggestions please to achieve both at same time.
thank you in advance.
best regards,
venkat.Hi G.V.Naidu,
According to your description, the first tablix is matrix to use display data.
In SSRS, if we want to fix matrix header visible while scrolling and repeat header columns on each page, we can select the corresponding option to enable this function. Please refer to the steps below:
1. Right click tablix, and select Tablix Properties.
2. Select “Keep header visible while scrolling” and “Repeat header rows on each page” to enable these function.
If we are use table to display data, please refer to the article about Repeat Header / Keep Header Visible in Tables.
http://blogs.msdn.com/b/robertbruckner/archive/2008/10/13/repeat-header-and-visible-fixed-header-table.aspx
If there are any misunderstanding, please feel free to let me know.
Regards,
Alisa Tang
Alisa Tang
TechNet Community Support -
Ssrs 2008 r2 straight line within a matrix
In an SSRS 2008 R2 new report have placed a matrix on the end of the report for information the user wants to see at the end of the report. The user wants to place a straight line between the different infomation sections in the tablix. Here are the problems
I am having:
1. In a row I would like to merge 2 cells together so that a line placed within the matrix is the same length. The problem is that I do not know how to merge the cells.
2. When I drag a line into a cell in the matrix, the line is not straight. The line points to an angle. I have tried to change the properties of the line on the endpoint values but that has not worked. Thus can you tell me how to make the line placed within
a matrix cell to be straight?Take a look at this post for inserting a horizontal (or vertical) line into a tablix cell:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/397d6dc4-766a-43c9-9706-5370a2bfaeb4/insert-line-into-table?forum=sqlreportingservices
For merging cells, you simply select a set of contiguous cells, right-click, merge cells. There is a catch of course. The catch is that all of the cells you are trying to merge must be in the same scope. Below are some screenshots showing a simple Matrix
with 1 column group and 1 row group.
As you can see in this screenshot, I have selected 2 adjacent cells that are both in the same scope, and merge cells is available.
In this screenshot, I have selected 2 adjacent cells that are not in the same scope. The left cell is only scoped by the row group while the cell on the right is scoped by both the row and the column group. As a result, I cannot merge the cells.
"You will find a fortune, though it will not be the one you seek." -
Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek. -
Ssrs 2008 r2 using parameter values
In an existing ssrs 2008 r2 report, I have a requirement from a user where they want to add 2 more parameters to the report. Right now there is an option where the user can choice to generate report1, report2, report3, report4, report5, report6, report7,
report8, and/or any combination of the reports I just listed.
This is setup by using an expression in the visibility property for each of the 8 tablixes.
For your information, the following is an example of how to display one of the reports or not:
=iif(InStr(join(Parameters!report.Value,","),6)>0,false,true)
Now the user wants to be able to add the parameters of customer and inventory_item based upon if report7 and/or or report8 is selected.
Now can you tell me the following:
1. Would you show me the code I can use in the dataset to select report7 and/or report8?
2. If the above is not possible to select specific reports, then would the dataset query need to look something like: where @report is null or where @report is not null? What would you suggest?Hi midnight_car,
According to your description, you have specified visibility for each tablix in a report with IIF() function. When you select 7 or 8, you want to add an additional parameter to filter displayed tablixes, right?
In Reporting Services, since we can’t specify the visibility of a parameter as an expression, we could add a cascading parameter. When the first value is 7 or 8, then selected values from the cascading parameter can filter the displayed tablixes. Please
refer to steps below:
1. Sample data.
2. Create a new dataset with the query below:
select distinct SalesTerritoryRegion as region from dbo.DimSalesTerritory
where SalesTerritoryRegion=
case when 3 in (@report)or 4 in (@report)
then SalesTerritoryRegion
else 'NA' end
3. Specify the parameter @region using the new dataset.
4. Query in main dataset like below:
select SalesTerritoryRegion as region,SalesTerritoryCountry as country,SalesTerritoryGroup as [group] from dbo.DimSalesTerritory
where SalesTerritoryRegion= case when 3 in (@report) or 4 in (@report)
then @region
else
SalesTerritoryRegion end
4. Preview the report.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
In a new ssrs 2008 r2 report, I need to display 2 of the parameter values in the heading of the report. One of the parameter values in the name and customer number. The second heading value is the city and state where the particular customer is located at.
The customer table has the following values:
a. cust_id int primary-id,
b. customer_name varchar(50),
c. cust_address1 varchar (50),
d. cust_address2 varchar (50),
e. cust_city_state varchar(40),
f. cust_zip_providence varchar(30),
g. cust_country varchar(30).
Thus I need to place the paramter values of customer_name and cust_city_state that are obtained from a dropdown list in the heading.
when I try =first(customer_name) in the heading, the value is only good for the first customer name. After that, the wrong parameter value is displayed.
Thus can you tell me and/or show me code of what I can do to place the parameter values
of customer_name and cust_city_state in the heading of the report?Follow below steps,
1. Create 3 Data set.
DS1 = select * from customertable
DS2 = select distinct customer_name from customertable
DS3 = select distinct cust_id from customertable
2. Add two parameter, customer name and customer number
--------parameter 1
- supply Name property for 1st parameter
- datatype for the parameter is string
- Available value property, Select dataset DS2, Select Field Value as "Customer_Name"
--------parameter 2
- supply Name property for 2st parameter
- datatype for the parameter is string
- Available value property, Select dataset DS3, Select Field Value as "Cust_id"
3. Add a blank tablix/table.
-- Select TableRow2 and right click to add new group i.e insert group.
-- Group properties window will be openned,
-- Select Group On Expression 1st.
-- Select the parameter(Parameter1/customer name) by double clicking in the expression window
-- Select Group On another Expression 2nd.
-- Select the parameter(Parameter2/Cust Id) by double clicking in the expression window
-- Now in the general tab you need to checked "Repeat Group Header"
-- press ok to close the group properties window.
4. Now from DS1 drag the field City and State in TableRow3 columns.
5. Drag the Customer Name and Customer Id/Number in TableRow1.
6. In case if First(Fields!CustomerName) appears then remove First function as simply "Fields!CustomerName". Similarly for Customer Number.
7. Finally we need to set the filter condition of the table property. Open the table property by right clicking. On the "Filter" tab choose the expression as "Fields" items and double click "CustomerName" to add in the expression. Similarly add second
field "CustomerNumber" in the expression. Check the operator "=" and choose the value as "Parameter" items respectively.
Regards, RSingh -
Ssrs 2008 r2 error-Forward pointing dependencies are not valid
In an existing SSRS 2008 r2, report, I am attempting to add a parameter called 'Customer_Category'. I am getting the following error message:
The report paramter 'CustomerNumber' has a DefaultValue or a ValidVaue that depends on the report parameter 'Customer_Category'. Forward pointing dependencies are not valid.
I am trying to determine how to fix this error. The 'CustomerNumber' is a parameter value that is obtained by reading from a dataset. In this dataset there are existing other parameters called 'Customer_Type' and 'Customer_Preference'. Both of these parameters
obtain there values from selections that the user makes when the SSRS report is executing. There are no default values.
I am trying to have the 'Customer_Category' be the same way where there are no default values and the user must select the parameter value when the report is executing. There should only be one value that the user can select from.
The new parameter called 'Customer_Category' is the last parameter in the list of parameters. Does the order of parameters make a difference? If so, how can I move the 'Customer_Category' parameter in front of the customer_number parameter?
Here is the sql that is used from obtaining a list of customers from the dataset for customer_number:
SELECT Distinct CustomerNumber
FROM BridgeUserCustomer
WHERE
Type = @Customer_Type
AND Preference = @Customer_Preference and Category = @Customer_Category
GROUP BY CustomerNumber
Would you tell me what is wrong and what I can do to solve the problem?Create independent datasets for each parameter and try once.
Regards, RSingh -
Ssrs 2008 r2 display only final total amount
In an existing ssrs 2008 r2 report, I want the final grand total to appear as the last amount displayed in the SSRS report.
In the 'main' matrix of the report, I have created an outside group row below the last line of the matrix.
The expresion for this statement looks the the following:
="Grand Total: $"+str(sum(cdec(Fields!TransactionAmount.Value),"datasetname")).
The total amount is correct, but this total amount line appears after every control break. Basically the amount appears every
time the control break changes by date, teacher, or student number.
The extra row I added does contain grouping references to date, teacher, and student number. Thus to solve my problem:
1. Can you tell me how to remove the grouping references to date, teacher, and student number so that the last row will be the only place the total amount will be displayed?
2. If the above is not an option, can you tell me how to add an extra row to the 'main' matrix so the report groupings do not appear on the final total line?
3. If the above 2 choices are not an option, would you tell me how to add the final total line in the final report footer and/or any place you believe the final total amount will appear only one time?Hi Wendy,
According to your description, you want to add a row into your matrix to get the total value of TransactionAmount. This can be final total value which appears only one time in your matrix. Right?
In this scenario, the reason why the total amount line appears after each break change (data, teacher..) because this total amount line is still within the parent group. I guess you didn't add the outside group row on the top parent group. So we just need
to right click on the textbox which is top parent group, insert a row outside of group. Then put your expression into the added row. Now the total amount will appear only one time in the matrix. It looks like below:
Reference:
Understanding Groups (Report Builder and SSRS)
If you have any feedback on our support, please click
here.
Best Regards,
Simon Hou -
SSRS 2008 R2 - Dynamic header data stays the same when exporting
Background:
I have a SSRS 2008 R2 report with a single Tablix.
The data is grouped by InvoiceID, with each appearing on a separate page.
I'm displaying some of the detail data in the group header row using Expressions similar to the following:
="Invoice # " & ReportItems!InvoiceID.Value"
The data referred to by my ReportItems statements are all hidden in the detail row (Advanced Mode, the Hidden Value for the Static Row Group is set to false).
Problem:
When I Preview the report in Visual Studio, everything looks as it should - the dynamic header data changes correctly with each group.
However, whenever I export the results (I've tried all the formats), the header data is the same for every group - its taking the values from the first group and using it in all the groups.
I've copied the same expressions into my Totals row, and the data is correct when exported; its only happening in my header rows.
Any help in resolving this is greatly appreciated, thank you.Hi Alex,
According to your description, you have a header with expression contains ReportItems. Now you find it shows incorrect result when exporting to a file. Right?
In Reporting Services, it has reported some similar issue that the ReportItem returns unexpected result when exporting. In this scenario, since you just want to show the group name in each page as a header for detail rows. So you can make the
detail rows group on the Group. Then delete the Group column but still keep the group. After that add a row above detail row (Out side of group) and put in "=Fields!InvoiceID.Value". Now it will show the corresponding Group name
when you set page break between each group instance. We have tested this case in our local environment. Here are screenshots for your reference:
Reference:
SSRS
field expressions using ReportItem refrences have unexpected results when exporting
If you have any question, please feel free to ask.
Best Regards,
Simon Hou
Maybe you are looking for
-
My new iMac has recently had OSX Lion installed on it and now when I start the machine it looks like its updating something every time, and the wireless doesn't work. So I restart and everything is OK - until I have to start up again the next time -
-
Ver 10.0.1. Entire screen blacks out for a few seconds when scrolling.
I recently updated to Reader X 10.0.1. Now when I scroll through a large document my entire screen blacks out for a few seconds. So far it has recovered. I get an error message saying that the NVidia nView driver (ver. 135.50) has stopped respondi
-
HT3798 Ipod Classic will not sync with windows 8 and newest itunes
I have ipod classic, 160gb, with new computer with Windows 8 and latest version of Itunes - came from xp and previous version of itunes - and never had a syncing problem. All my songs are in new itunes on new computer, however ipod will not sync. H
-
What is the best way to create a dot matrix effect
Hi. I want to print something with a single solid (pantone) colour (not process), but I also want to give my simple graphic some shading. I have added some transparency to see the effect, but as far a printing the final product I need a solid single
-
Tiger - All Sahring Options/Services disabled, greyed out
Hello from Portugal! I noticed that on System Preferences I had all my Sharing services disabled and cannot select any of them (greyed out). Also, the Firewall Tab was disabled to (greyed out), and I couldn't select it either. I noticed that as the f