Excluding Records with Null Values

  • Hello, all:

    This is probably an idiotic question, but I'm new to this, so please bear with me!

    I have a report that displays attendance data by US state, in the matrix of which I've included the following filter:

    Expression: =Fields!Country.Value

    Operator: =

    Value: ="United States"

    In the dataset itself, there are some records whose country is listed as "United States", but for whatever reason, the State field is null. I'd like to filter out those records on my report, but I can't for the life of me figure out the syntax for a filter that will exclude records whose State value is null. Can anyone help?

    Thanks!

  • lk (1/22/2009)


    I have a report that displays attendance data by US state, in the matrix of which I've included the following filter:

    Expression: =Fields!Country.Value

    Operator: =

    Value: ="United States"

    My first suggestion would be to modify the where clause of your dataset so that it only pulls back records

    WHERE Country = 'United States' AND [other_field] IS NOT NULL

    However, if you either cannot, or choose not to, modify the dataset query, then you might try adding another filter like

    Expression: =Fields![other_field].Value

    Operator: !=

    Value: blank (the option in the drop down with the greater than and less than signs around it - message stripped it out as HTML tags when I tried to type it)

  • Thanks, TKD-BB! I would prefer not to alter my dataset, as it runs a stored procedure that I use for multiple reports, so I tried your second suggestion. Unfortunately, the blank didn't work for me, but I did end up figuring it out!

    I used your filter, except I changed the Value to =Nothing--but the real issue was that I was applying the filter to the matrix but not to the State group. Once I applied the filter in both places, it worked like a charm!

    Thanks again for your help! 😀

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply