I'll suggest a minor modification to Peter's script. This accounts for people who use the list view in their calendar on MyCRM. I had a customer who had hundreds of tasks and events, and didn't want to see all of them when they were looking at their calendar, but did want to see all of them when looking at customers.
if (Values(""Key0"") == 4) {
DefaultValue = ""Pending"";
} else {
DefaultValue = ""--All--"";
}