Not Showing Groups When A Field Value's 0
Oct 18, 2007does anyboy know how to not showing a group rows if one of its field value is zero?
thanks,
Addin
does anyboy know how to not showing a group rows if one of its field value is zero?
thanks,
Addin
I'm trying to show the max date from a field by group. I've tried Max(OrderedDate) but it still shows me all the dates from the group field I only want to see the last date. I'm using report builder FE, which I can't modify the BE. Any ideas I can get this to work?
View 1 Replies View RelatedI have some data where a bit value changes over time and I want to rank it by the repeating groups, how do I write the SQL so that I get the result below?
I want to sort by create date, and every time the bit changes value we start the rank over.
If I partition by the bit field, it will just group the entire data set by the bit field.
Bit CreateDate Rank
1 3/15/2014 1
1 3/14/2014 2
0 3/9/2014 1
0 3/8/2014 2
0 3/6/2014 3
1 3/4/2014 1
0 2/28/2014 1
0 2/20/2014 2
0 2/15/2014 3
0 2/10/2014 4
I have a new SQL 2005 (SP2) Reporting Services server to which I've just upgraded and deployed some SSRS 2000 reports.
I have a subreport that contains a matrix with two groups. The report data seems to be inexplicably repeating the data for the first row in the group for all rows in the group. Example:
ID1
ID2
DisplayData
1
1
A
1
2
B
1
3
C
2
1
A
2
2
B
2
3
C
Parent group is on ID1, child group is on ID2, report would show:
1
1
A
2
A
3
A
2
1
A
2
A
3
A
Is this a matrix bug in 2005 SP2, or do I need to do something differently? I can no longer pull a comparison version from an SSRS 2000 server to verify, but I believe it was working as expected before...
I'm new to SQL and I'm trying to write a statement to satisfy the following:
If [Field1] contains text from [Field2] then return [Field3] as [Field4].
I had two tables where there were no matching keys. I did a cross apply and am now trying to parse out the description to build the key.
Good morning...
I begin with SQL, I would like to add a field that will be date like 21/01/2000.
Actually i find just "datetime" format but give me the format 21/01/2000 01:01:20.
How to do for having date and time in two different field.
Sorry for my english....
Cordially
A newbie
I expect to get a record below with a count of 0 (and I do), but when I take the comments out (--) of lines 1 & 6 I don't understand why I get no records at all. I need to be able to see all teams in EvalAnswers even if none of the records satisfies the where clause.1 select Count(*) as cnt--, TeamID
2 from EvalAnswers
3 where CoID=@CoID
4 and EvaluatorID=@EvaluatorID
5 and (Scr0=0 and Sugg0 is NULL)
6 --group by TeamID
7
Hi,
I would like to create groups in SQLServer2000.Do i need to do this by roles or can i create groups for each database.I read some where that there where
no groups for SQLServer7.0. Is this option available for the latest versions.
Any help will be appreciated.
Thanks in Advance.
Ran.
If you have a SAN, is there any real benefit to breaking out large tables into file groups?
View 1 Replies View RelatedI have a Attendance table named say Attendance which has Class and Status along with some other fields.Class will have the name of the class the student is in,whereas the status will have the Absent/Present data.There is another table named say ClassMaster which is the master which will have all the classnames and there is a column of ClassTeacher which will have the EmployeeCode.This employeeCode comes from a table EmployeeMaster.My requirement is i want to get the count of Absent students in Attendance table depending on the Class.For Example if there are two class say ClassA and ClassB,then i should get the count of the Students from Attendance table that belong to Class A and Class B.How cn i do this in one Query.
View 1 Replies View RelatedI am looking to find out when to use file groups when backing up. When should you use this, what's the benefit over just doing a full db backup? Is it better when you are dealing with large db's?
Also this question has been on my mind for a while. Why shouldn't you shrink the db after every full backup? What is the negative in doing so?
Thanks
I realize the irony of asking this here, but does anyone know of any MySQLgroups where I can ask my questions?Thanks.
View 1 Replies View Related
In my report I have 3 row groups and two column groups as follows, where measure is number of hours for a given project.
2008/05 2008/06 ........
Demand | Allocated Demand | Allocated
- Project 1 1500 1000
- Department1 500 400
- Employee1 200
- Employee2 200
- Department2 1000 600
- Employee3 300
- Employee4 300
+ Project 2 1200 1000
-------------------------------------------------------------------------------------------------------------------------
Grand Total 2700 2000
My question is, is this possible using a Matrix? I have used matrix in some of my reports but have always used automatic/generic SUM feature it provides.
Note carefully that there are no values for Employees in Demand Column Group. Basically I would have to SUM Department groupings to get the Project level total and then SUM all Project Groupings to get the grand total. The Allocation column is okay since the Employees have values in that column. Can this be done using InScope( ) or some other function rather than simply doing the Generic SUM of Rows and Columns of the matrix which would probably throw error when trying to sum a blank value in demand column.
Thanks in advance.
How do I put information only at the top of a page and have it change whenever a group occurs.
I want to do something like this. Have this on the top of every page:
Country: current country
State: current state
City: current city
There is a group on country, state and city. Whenever city changes the next page will display a new city. Whenever state changes the next page will display the new state in the header.
I have already put Country, State, and City into their own group headers. However, if either of them change in the middle of the page then the group header repeats. I have group header repeat on so I can see it on each page. If I choose the Page break at start then it breaks but I don't want it to break. I want it to run on the same page if it passes a group and then have the next page display relevant information for the group.
Putting it in the table header works as far as keeping them all on the top of the page but it doesn't change when a grouping ends.
Please assist me in anyway you can.
Thanks,
Sarah
I have my first SSRS report going, after years on Crystal and Access. It has several groups, each nested within the next...I think. I'm having a little trouble with the groups...well, grouping the way I thought I had it set up. The groups come out looking like my primary group is second instead of first, although when I look at the groups in "edit groups" it appears I have them set up correctly.
In Crystal, on the preview page you could see the groups idendified so if there was a problem in a report you could tell what group it was coming from. You could also select and change objects in preview, which made it nice to see the impact of changes. I cannot see either of these features in SSRS. I'm hoping that there's a setting I need to turn on, and also hoping that this product has these user friendly features. Any ideas on that?
Also, in Crystal, when you set up a group or a formula, it became available in the field list within the formula builder, so you could use them by picking them instead of typing the whole thing in again, and that's not available either. Or I can't find it!
Since I'm new to SSRS maybe there are features and settings I haven't found yet, but would appreciate any comments from more experienced users about the overall usability of this tool.
Thanks!
Is there any way to keep a table group together. MSFT says no but I can't believe this limitation exists. It's a basic reporting function in any reporting software I've used.
I have one group in a table. I don't want the detail rows to be split when it gets to the bottom of the page.
Server:
Sql 2005 SP2 running on Win2003 Ent. SP1
I have a 3rd party app that needs me to add a user to the SQLServer2005SQLAgentUser group for the instance I placed the DB in. This group doesn't exist on my server for any of my instances. Is there a simple way to generate it or a document that can tell me how to manually create it?
Hi everyone,
When I do the following, did I put the files in Test1FG1 file group to the default file group(Primary) ?
ALTER DATABASE Test1
MODIFY FILEGROUP Test1FG1 DEFAULT
GO
Thanks
I'm wondering if there is any way in RS to create what Crystal reports calls Custom or Named Groups. This functionality allows you to define groups based on the values found in one of the fields on your report. For example, if I were grouping on a person's last name and I want 3 groups based on the first letter: A-G, H-P, Q-Z. I would want to keep it contained in one table.
View 6 Replies View RelatedHi All,
I have a challenging report to create. I need to create a report where I'll have groups then I need to have a ceiling on the group to print only 10 records (if there are more than 10 records) then go to the next page and print the final records for that group. I can do the grouping and I can do the ceiling, but I am having a hard time doing both. I'm open for any suggestions.
Thanks
Hi everyone,
While creating our database in only one disc(C or D), suppose that we create more than one file group in order to group our data files. However, in this situation; I wonder that whether it brings any benefit or advantage to us.
Also, I wonder that why we always have to put our data file into separate file group if we use separate discs for data files. Is not it allowed to use only one file group even if we use separate dics ?
Would you explain these to me ?
Thanks
Hello,
in a report in Reporting Services 2005 I want to create a top count 100 for groups.
I have a report sheet with a table containing some groups.
Under the groupings there are other groupings and so on.
Now I want that only the top 100, ordered by a value on group level of the 1st group are contained in the report.
Any ideas?
Best regards,
Stefoon
Is it possible that i can create a SQL Server Group in sql 2005. Eg. in 2K when u right click (in Enterprise manager) on Microsoft Sql servers you can see "New Sql server Group". I am talking about this group. I have many servers in NYC and Dallas and in VA. I want to group them in the group names NYC DAL VA. is it possible.
View 12 Replies View RelatedI am thinking of updating my SQL monitoring application to use Service Broker.
Right now I loop through my list of servers performing various checks on each server. Things like 'check last database backup', 'check for new databases', 'check for server restart'. I loop through, one server at a time, doing one check at a time. The more servers I have the longer it is taking.
So, I want to multi-thread the servers, but single-thread the checks on each individual server. This way I can check say, 5 servers at a time, but on each server I will only do one check at a time. This way I won't flood an individual server with multiple checks.
Is this possible? It looks like Conversation groups might be the way to go but I'm not sure.
I'm having some troubles with conversation groups. I need to send two messages on the same conversation group so I have the following in my SP....
BEGIN DIALOG CONVERSATION @providerConversationHandle
FROM SERVICE [ProviderDataService]
TO SERVICE 'CalculatedDataService'
ON CONTRACT [ProviderDataContract]
WITH ENCRYPTION = OFF
, LIFETIME = 600;
BEGIN DIALOG CONVERSATION @curveConversationHandle
FROM SERVICE [ProviderDataService]
TO SERVICE 'CalculatedDataService'
ON CONTRACT [ProviderDataContract]
WITH RELATED_CONVERSATION = @providerConversationHandle
, ENCRYPTION = OFF
, LIFETIME = 600;
SEND ON CONVERSATION @providerConversationHandle
MESSAGE TYPE [ProviderDataMessage] ( @providerMessage );
SEND ON CONVERSATION @curveConversationHandle
MESSAGE TYPE [ProviderCurveMessage] ( @curveMessage );
When I query the queue I see two messages, but they don't have the same conversation_group_id.
Any ideas?
Thanks.
Using: SSRS 2005, SSAS 2005Question: Can we use Filter Top N on Groups?
Detail:I have a table in RS with data sourced from an AS cube that has a structure like this:
Category Date Quantity
======== ======== ========
+ Cat1
2008-01-01 3,000
2008-01-02 5,000
2008-01-03 7,000
2008-01-04 9,000
2008-01-05 4,000
2008-01-06 2,000
2008-01-07 5,000
Cat1Total 35,000
+ Cat2
2008-01-01 2,000
2008-01-02 5,000
2008-01-03 6,000
2008-01-04 8,000
2008-01-05 3,000
2008-01-06 1,000
2008-01-07 5,000
Cat2Total 30,000
+ Cat n...
I want to return only the top 10 categories by descending quantity.
I can't get the filter to work on either the table or group level properties.
FILTER:Expression: =sum(Fields!Quantity.Value)Operator: TopNValue: 10ERROR:Failed to evaluate the FilterValue
Do the Top and Bottom functions only work on the detail level?
Is there some other method I should be using?
I've tried to do this with the query using the MDX AGGREGATE function but having trouble getting it to return proper results. (Details in this thread: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3203246&SiteID=17 )
So as a workaround to get the project delivered on time, I'm reluctantly bringing in the date level and trying to do the aggregations and filtering in the RS table.
Any help would be appreciated.
-Michael
I know how to hide groups using Expressions that use parameters that can be passed in, but can you hide groups that are inside other groups. Here is my situation. Our company has different organization levels. On reports the users want to select which organization levels they want to see the #s for. So I set up groups for each org level like so....
Org Level 1
Org Level 2
Org Level 3
The data results are like so
Org Level 1 Org Level 2 Org Level 3 Category $ Amount
USA Midwest Kansas 1 500.00
USA Northeast Maine 1 200.00
And I sum the $ Amount Per Category for each Org Level using grouping in the report.
Then based on the selections they make it hides the org levels they don't need to see. The issue is that the report will not show org level 2 or org level 3 if org level 1 is not visible, and org level 3 can't be visible if org level 2 isn't visible, etc.....Anyone know a solution to this situation, I know this has had to have come up.
Thanks,
Adam
We have began to use Windows AUthentication for our SQL 2000 Server. When we llok atthe groups in AD we do not see any Domain Local groups? Is there a reason for that? Can I just add the group without browsing? I assume DLG will work with SQL for security.
Thanks
Brent
I am having a bit of trouble with the sorting of grouped data.
I have a data set that returns sales data for stock items between a user specified date range. As a result I have to group by the stock items (description or code depending on a parameter value) to prevent displaying duplicate stock items and to get aggregate sales data. However I also need to be able to sort this group by three other aggregates but have not been successful. I have done the following:
The group expression is as follows:
Function Group4(fields As Fields) As String
Dim Group As String
If( Report.Parameters!ReportSetting_ReportType.Value <> "1" AndAlso Report.Parameters!ReportSetting_DetailSummary.Value = "1" ) Then
Group = fields!Group2Desc.Value
Else
If Report.Parameters!ReportSetting_SortType.Value = "1" Then
Group = fields!StockDesc.Value
Else
Group = fields!StockCode.Value
End If
End If
Return Group
End Function
The sort expression for this group is as follows:
=Sum(Code.SortExpressionNumeric(Fields), "table1_Group4")
where SortExpressionNumeric is as follows:
Function SortExpressionNumeric(fields As Fields) As Decimal
Select Case Report.Parameters!ReportSetting_SortType.Value
Case "3"
Return fields!TillSalesValue.Value
Case "4"
Return fields!TillSalesQty.Value
Case "5"
Return GrossProfit(fields)
Case Else
Return 0
End Select
End Function
where GrossProfit is another function that returns a decimal value.
When I preview my report with ReportSetting_SortType = 1 or 2 everything displays as expected. However when I set ReportSetting_SortType = 3,4 or 5 the data does not sort how I need it to.
Can anybody see what I might be doing wrong?
Hi all,
I have two Selects that I want to union into one table:
The first select has this data:
Date | Yes
2004-11-20 | 4
The second select has this data
Date | No
2004-11-20 | 3
When I unioned them I want the data to show as:
Date | Yes | No
2004-11-20 | 4 | 3
I thought that I could make a 'dummy' column for each of the selects, union them and it would work right, but the output I am getting is:
Date | Yes | No
2004-11-20 | 4 | 0
2004-11-20 | 0 | 3
Can someone point me in the right direction?
Thanks,
Mike
SELECT sysjobs.name, sysjobservers.last_run_outcome, CONVERT(varchar(8), sysjobservers.last_run_date, 112) AS LastRunDate, CONVERT(varchar(8),
sysjobservers.last_run_time, 8) AS LastRunTime, GETDATE() AS CurrentDateTime
FROM sysjobs LEFT OUTER JOIN
sysjobservers ON sysjobs.job_id = sysjobservers.job_id
WHERE (sysjobservers.last_run_outcome = 0) AND (CONVERT(varchar(8), sysjobservers.last_run_date, 112) >= DATEADD(day, - 1, GETDATE()))
I am wanting a similar solution, I need to convert an "int" to a time format, when I use this where ">= DATEADD(minute, - 720, GETDATE())" for the last_run_time I get this error:
Syntax error converting datetime from character string.
Hi,
I have two tbls joined via a varchar field.. which in tbl I have to use a CASE statement to format it correctly for the JOIN..
All works well.. however, if I add a WHERE clause to the statement, with the WHERE clause affecting only one of the JOINED tbls.. All the NULLS are not shown.
I should get results like:
Postcode Count
tf4 0
tf5 23
tf6 15
tf7 0
etc
Whereas, when I add the where clause, none of the "zeros" are shown, so I get:
tf5 23
tf6 15
Why is this?
Here's the SQL:
SELECT ISNULL(COUNT(CASE LEN(REPLACE(dbo.Customers_Trade.PostCode, ' ', '')) WHEN 5 THEN LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 2)
WHEN 6 THEN LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 3) ELSE LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 4) END), 0)
AS PCCount, dbo.UkPostcodes.Postcode, dbo.UkPostcodes.Town, dbo.UkPostcodes.County, dbo.UkPostcodes.Area, dbo.UkPostcodes.Country,
dbo.UkPostcodes.Master_Account
FROM dbo.UkPostcodes LEFT OUTER JOIN
dbo.Customers_Trade ON dbo.UkPostcodes.Postcode = CASE LEN(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''))
WHEN 5 THEN LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 2) WHEN 6 THEN LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 3)
ELSE LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 4) END
WHERE (dbo.Customers_Trade.TradeCustomerID IN
(SELECT DISTINCT TradeCustomerID
FROM dbo.Orders_Trade
WHERE (DATEDIFF(d, order_date, GETDATE()) < 60))) AND (dbo.Customers_Trade.is_activated <> 'No') OR
(dbo.Customers_Trade.BillingAccountID <> '') AND (dbo.Customers_Trade.BillingAccountID IN
(SELECT DISTINCT TradeCustomerID
FROM dbo.Orders_Trade
WHERE (DATEDIFF(d, order_date, GETDATE()) < 60) AND (is_activated <> 'No')))
GROUP BY dbo.UkPostcodes.Postcode, dbo.UkPostcodes.Town, dbo.UkPostcodes.County, dbo.UkPostcodes.Area, dbo.UkPostcodes.Country,
dbo.Customers_Trade.Master_Account, dbo.UkPostcodes.Master_Account
does not show the nulls:
where as:
SELECT ISNULL(COUNT(CASE LEN(REPLACE(dbo.Customers_Trade.PostCode, ' ', '')) WHEN 5 THEN LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 2)
WHEN 6 THEN LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 3) ELSE LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 4) END), 0)
AS PCCount, dbo.UkPostcodes.Postcode, dbo.UkPostcodes.Town, dbo.UkPostcodes.County, dbo.UkPostcodes.Area, dbo.UkPostcodes.Country,
dbo.UkPostcodes.Master_Account
FROM dbo.UkPostcodes LEFT OUTER JOIN
dbo.Customers_Trade ON dbo.UkPostcodes.Postcode = CASE LEN(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''))
WHEN 5 THEN LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 2) WHEN 6 THEN LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 3)
ELSE LEFT(REPLACE(dbo.Customers_Trade.PostCode, ' ', ''), 4) END
GROUP BY dbo.UkPostcodes.Postcode, dbo.UkPostcodes.Town, dbo.UkPostcodes.County, dbo.UkPostcodes.Area, dbo.UkPostcodes.Country,
dbo.Customers_Trade.Master_Account, dbo.UkPostcodes.Master_Account
I am using the Server Explorer in VS2005. I have created an additional field in a small test table with 3 other fields. The new field called foo_key does not show up when I query the table ( it has 7 records ).
I have some tables that I'd like to insert an auto-incrementing integer primary key. But at this point I cant figure out what's wrong. I have toggled the field as primary key on and off.It seems if I create a new table, then I see the primary key field and its autoincrementing as desired.
Could it be that I cannot add such a field if my table already has some records ? ...and to get one in would mean rebuilding a new table and shifting the records....pls advise
andrewcw