Question

this is what i want: ss1

my problem is getting that last total. my data has tasks from 5000 - 9000 and they each have a description and budget etc ...

i am currently grouping and doing a total based on this expression in a calculated field:

Left(CStr(Fields!Task_Code.Value), 2) & "00"

it just strips the last 2 digits off the task and groups. so there is a subtotal for all 5100 and there is a subtotal for all 5200 etc ...

well now i need to group and total on ranges of tasks. so i need a group/total on 5100-5900 and a group/total for 6200-6500 and so on. its arbitrary so i would just like to provide a range, rinse and repeat. how can i do this? below is a screenshot of it as well: ss2 the expression in the screenshot is just a switch statement for labels, its not the expression above.

Was it helpful?

Solution

Based on your above data, I would use a couple of Calculated Fields and apply two groupings based on these.

Using the above data (plus a few more rows for demonstration):

enter image description here

I've added two Calculated Fields:

Group

=Switch(Left(CStr(Fields!Task_Code.Value), 2) = "51", "Group1"
    , Left(CStr(Fields!Task_Code.Value), 2) = "52", "Group2"
    , Left(CStr(Fields!Task_Code.Value), 2) = "62", "Group3")

Location

=Switch(Fields!Task_Code.Value >= 5100 and Fields!Task_Code.Value <= 5900, "Location1"
    , Fields!Task_Code.Value >= 6200 and Fields!Task_Code.Value <= 6500, "Location2")

enter image description here

For Location, I've assumed that Task_Code is integer based; you could always use CInt as required if this is not the case.

I've created a table with a Details group and two groups based on the Calculated Fields:

enter image description here

Results looks like the requirements:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top