Monday, March 19, 2012
Group Filtering?
Maybe this problem seems too stupid for someone, but I'm going out of my mind.
This is my aim, I want to specify the terms for many groups, for example (nothing to do with the real data):
I have a population data, and I need three groups:
- The first one, with the people who are up to 20 years old and their name is "Jack"
-The second one, with the people who are between 21 and 60 years old, and their weight is over 50 pounds.
-The last one, with the people whose address is "Example st." and live in England.
The problem I'm having, is that I don't know where to put this selection criteria, because the select expert applies the filter to all the data, and I can't use it for another group. Besides, any new group I create is nested with the previous gruop, so the data source is already filtered.
Thanks in advance!
PD: I am using CR embedded in Visual Studio 2005Create a formula @.Groupping like this one:
if {table.person_age}<=20 and {table.person_name}='Jack" then 'Age20_name' else
// or {table.person_name} like '*Jack*' - depend on what you have in your
// {table.person_name}field just the first name or his/her full name
if {table.person_age}>=20 and {table.person_age}<=60 and {tble.person_weight}>=50 then '21_60_50lb' else
if {table.address} like {*Example*st*} and {table.country}='England' then 'addr_country'
Then group your records on that formula.
If you have a situation when the same person has to be included in several groups, then you will need to use a subreports. Show those from group1 in your main report, those records has to be included in Group2 in your 1 subreport and those from the Group3 in your second subreport.
And one thing more: there is no stupid questions aspecially if you're going out of your mind.|||[quote]
If you have a situation when the same person has to be included in several groups, then you will need to use a subreports. Show those from group1 in your main report, those records has to be included in Group2 in your 1 subreport and those from the Group3 in your second subreport.
[quote]
Just a stylistic note.. I would put all of the groups into sub reports, and just have the main report include all of the sub reports (i.e. I would not treat the first group differently...)|||Thank you for your coment, TheCPUWizard.
I agree with you. My point (which may be wrong) was if there are less subreports the main one, it will work faster.
Just a stylistic note.. I would put all of the groups into sub reports, and just have the main report include all of the sub reports (i.e. I would not treat the first group differently...)[/QUOTE]
Sunday, February 26, 2012
Group by Date
Hi all,
Firstly: I'm a newbie when it comes to reporting services (previously used to Crystal reports).
This is probably going to appear as a stupid question but here goes.
How do i group on a date time field. I have set up a report with a table and as my group i have selected my datetime field
[code]
=Fields!WeekBegin.Value
[/code]
When i group on this field each record still seems to have its own grouping even though all entries in my test database have the same date. I have noticed that the seconds don't match up on some entries and believe that this may have something to do with it. There are however still duplicates that should be grouped on. I really only want to group on the date part of the Datetime field.
Anyone got any ideas where i am going wrong.
Thanks in advance
Grant
If you only want to group on the date part, you can use the datevalue() function:
=datevalue(Fields!WeekBegin.Value)
or use the Format function to get the date part.