Default values on parameters for filters

  • What I have is a report with 2 filters - Both have the same potential values.

    Filter 1 will always have all options - So options 0, 1, 2, 3 & 4

    If Filter 1 is set to Option 1 say that will be removed from the list for Filter 2, so Filter 2 now has Options 0, 2, 3 & 4. Filter 2 has a default of Option 2 - unless of course Filter 1 is set to option 2 in which case it would be removed from the list, and the default would be set to Option 0.

    This all works fine but the problem occurs when Filter 1 is set to Option 2 and Filter 2 is set to Option 1, Filter 1 is then changed to Option 3 - This triggers an update of Filter 2, setting it to the default of Option 2.

    What I think I need to do is to set the Option selected for Filter 2 in to a variable and then use this in the calculation for the default value.

    What I can't find is how to set the selected option in to the variable.

    Is this the right way to go or is there another way to get the correct results?

    Cheers

    Andy

  • How are you entering the values for your child parameter? Are you getting values from a query? If so, I'd recommend using a clause to remove the Filter1 value from the available values of Filter2

    SELECT Filter2 FROM Table

    EXCEPT

    SELECT Filter2 FROM Table

    WHERE Filter2 = @Filter1

    or

    SELECT Filter2 FROM Table

    WHERE Filter2 != @Filter1

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

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