Grouping with Data from Other Data Source
Posted: Mon Jan 26, 2009 8:58 am
Hi,
Is it possible to use an expression or calculated column when using the 'Groups' tab while designing a 'Data from other Data Source'?
For example, lets say there is a list of students with different ages ranging from 18+
If I wanted to categorize them I could use a calculated column within the main Data source to do something like:
This would produce 1 or 4 groups
40 and Over
31 - 40
21 - 30
0 - 20
For a standard listing this would print:
I'd like to be able to take this data set and use it for grouping with the 'Data from other Data Source' so that I could select the Calculated Column for AgeGroup from the Groups tab or else specify an expression like above.
Then on the Results tab I could run a count aggregate for studentID leaving me with a data source of
This data could then be plotted on the Chart component using a pie chart or bar charts.
Is there any way to achieve the above without having to modify the original data set registered with the report?
Is it possible to use an expression or calculated column when using the 'Groups' tab while designing a 'Data from other Data Source'?
For example, lets say there is a list of students with different ages ranging from 18+
If I wanted to categorize them I could use a calculated column within the main Data source to do something like:
Code: Select all
{(Student.Age > 40 ? "40 and Over" : (Student.Age > 30 ? "31 - 40" : (Student.Age > 20 ? "21 - 30" :"0 - 20")))}
40 and Over
31 - 40
21 - 30
0 - 20
For a standard listing this would print:
Code: Select all
Age Group Name
18 0-20 Student 1
32 31-40 Student 2
36 31-40 Student 3
39 31-40 Student 4
26 21-30 Student 5
... etc... etc....
I'd like to be able to take this data set and use it for grouping with the 'Data from other Data Source' so that I could select the Calculated Column for AgeGroup from the Groups tab or else specify an expression like above.
Then on the Results tab I could run a count aggregate for studentID leaving me with a data source of
Code: Select all
AgeGroup, Total Count
0-20 1
21-30 1
31-40 3
This data could then be plotted on the Chart component using a pie chart or bar charts.
Is there any way to achieve the above without having to modify the original data set registered with the report?