Reputation: 346
I have a dataset that has 2 fields. Like below:
Change Number | Project Reference
1251554456465 | 5336
2546546546546 |
3216546546466 | 5534
Some values in Project Reference will have null entries.
I want to show a Pie chart that shows 2 categories based on this data: Category 1 - Changes that have a Project Reference Category 2 - Change that have NO Project Reference (ie project reference is null)
I have tried to do an expression in the Category Groups section like below:
=(Fields!projectRef.Value is nothing)
This shows
I think I am halfway there I just need help to finish it off and include the category where the expression results to false as well.
Upvotes: 0
Views: 7281
Reputation: 39586
You were on the right track.
For the Category Group expression, use something like:
=IIf(IsNothing(Fields!projectRef.Value), "Has Project", "No Project")
i.e. use an IIf
expression to assign one of two values based on the result of the IsNothing
expression, which checks for NULLs.
With your data:
I have a simple Chart:
The value is just a count of items in the category.
I've set Label and Group on to the expression above under the Category Group properties:
Result looks good:
Upvotes: 1
Reputation: 303
Off the top of my head I think its something like system.dbnull.value or system.dbnull that you need to compare to
eg:
=(Fields!projectRef.Value = System.DbNull.Value)
or
=(Fields!projectRef.Value = System.DbNull)
Upvotes: 0