When Television Shows Go Past Their Sell By Date

It has to be difficult for the television companies funding each show to know when to call it a day, if the show still gets a reasonable audience then do you walk away and pull the plug and disappoint many people and lose advertising revenue or should the show go on.