As the display ranges of RDLC pie charts show instead of individual values
I have some data coming from a custom dataset that looks like this
Human age
P1 20
P2 21
P3 30
P4 31
P5 40
And I want to design a pie showing the age distribution by age.
The thing is, I want this age to be displayed in ranges. (20-29, 30-39, etc., for example Thus, we have: Slice with total number = 2 (P1 + P2) by age is 20-29 (one at 20 and the other at 21)
Slice with total number = 3 (P3 + P4) by age 30-39 (one at 30 and the other at 31)
Slice with total = 1 (P5) at age 40 (one in 40).
How can I set up a pie chart to aggregate values ββacross ranges that I can define?
+2
a source to share
1 answer
Right click Chart -> Data -> Category Groups, Change "Data Values" to Expression and Labels to something like
=Switch(
Fields!Age.Value < 25, "Under 25",
((Fields!Age.Value >=25) AND (Fields!Age.Value < 35)), "26 - 35",
((Fields!Age.Value >=35) AND (Fields!Age.Value < 45)), "36 - 45",
((Fields!Age.Value >=45) AND (Fields!Age.Value < 55)), "46 - 55",
((Fields!Age.Value >=55) AND (Fields!Age.Value < 65)), "56 - 65",
Fields!Age.Value > 65, "Over 65"
)
+2
a source to share