Continuing on the theme of where Andy Fisher wandered into my head from . . .
Another offbeat '70s TV detective was Columbo, who came off like a dope but was actually a genius at solving crimes. He dressed a bit better than Andy does, but Andy does use some of his schtick.
Here's a great scene that deals with things even Andy would find interesting: