For close family members, we would all go, regardless of age. My DD attended her first viewing at about 4 months of age. It was the brother of her babysitter who lived with the babysitter. We took DD mainly so that the babysitter could give her a hug (which babysitter badly needed). But I had a close family friend who died at about that same time, and I didn't take DD (no connection to DD).
Both kids went to the funeral of their great grandmother when they were 6 and 8, but didn't go to the viewing (it was about 3 hours long, and I thought they would be bored, and be disruptive).