Hi all,
I am using CR2008 and DB is in SQL Server 2008.
Perhaps this is just impossible, but I am trying to find solution to dilemma, where I would need to select certain records and group and calculate values based to group.
Records
{leg_ID},{date},{person},{time}
leading to
1,1.4.2012,Andy,1.5
1,1.4.2012,Bill,1.5
1,1.4.2012,Leon,1.5
1,1.4.2012,John,1.5
2,1.4.2012,Andy,3.0
2,1.4.2012,Mike,3.0
3,1.4.2012,Leon,5.0
3,1.4.2012,Rick,5.0
1,2.4.2012,Mike,1.5
1,2.4.2012,Olav,1.5
1,2.4.2012,Anke,1.5
Now I would need to find totals to:
1. When Andrew is without Mike as 'person' (rest 'person'-records on that Leg_ID can be whatever but not Mike)
2. When Mike is without Andy as 'person' (rest 'person'-records on that Leg_ID can be whatever but not Andrew)
3. When Mike and Andy are 'person' on this leg_ID (rest 'person'-records can be whatever)
4. When no Mike and neither Andy are 'person', and on the leg_ID 'person'-records are whatever
Outcome should upon example be
1. Group "Andy" total time = 1.5
2. Group "Mike" total time = 1.5
3. Group "Andy&Mike" total time = 3.0
4. Group "Other" total time = 5.0
I have tried to arrays, selecting cases, and with that make formula (@pax} and then group based on that. I can get two groups, where cases 1. and 2. are somewhat well. But this simply does not work, and it puts 'person'-records to many groups. And needless to say, time calculations go wrong, when I total groups. It gives {time} as many times as it finds 'person'-records.
Any help or is this mission impossible? Or should I make something totally different to catch the outcome right?
I am newbie in CR, sorry folks.
Rgds
augsburg
I am using CR2008 and DB is in SQL Server 2008.
Perhaps this is just impossible, but I am trying to find solution to dilemma, where I would need to select certain records and group and calculate values based to group.
Records
{leg_ID},{date},{person},{time}
leading to
1,1.4.2012,Andy,1.5
1,1.4.2012,Bill,1.5
1,1.4.2012,Leon,1.5
1,1.4.2012,John,1.5
2,1.4.2012,Andy,3.0
2,1.4.2012,Mike,3.0
3,1.4.2012,Leon,5.0
3,1.4.2012,Rick,5.0
1,2.4.2012,Mike,1.5
1,2.4.2012,Olav,1.5
1,2.4.2012,Anke,1.5
Now I would need to find totals to:
1. When Andrew is without Mike as 'person' (rest 'person'-records on that Leg_ID can be whatever but not Mike)
2. When Mike is without Andy as 'person' (rest 'person'-records on that Leg_ID can be whatever but not Andrew)
3. When Mike and Andy are 'person' on this leg_ID (rest 'person'-records can be whatever)
4. When no Mike and neither Andy are 'person', and on the leg_ID 'person'-records are whatever
Outcome should upon example be
1. Group "Andy" total time = 1.5
2. Group "Mike" total time = 1.5
3. Group "Andy&Mike" total time = 3.0
4. Group "Other" total time = 5.0
I have tried to arrays, selecting cases, and with that make formula (@pax} and then group based on that. I can get two groups, where cases 1. and 2. are somewhat well. But this simply does not work, and it puts 'person'-records to many groups. And needless to say, time calculations go wrong, when I total groups. It gives {time} as many times as it finds 'person'-records.
Any help or is this mission impossible? Or should I make something totally different to catch the outcome right?
I am newbie in CR, sorry folks.
Rgds
augsburg