[Problem] To provide a GPR40 activator, particularly an insulin secretion stimulator or a prophylactic and/or therapeutic agent for diabetes, obesity or the like, which contains a novel compound having a GPR40 agonistic activity, a salt of the compound or a solvate or the like of the compound or the salt as an active ingredient.[Solution] A compound represented by formula (I) [wherein n represents 0 to 2; p represents 0-4; h represents 0 to 3; j represents 0 to 3; k represents 0 to 2; the ring B represents an aryl group or a heteroaryl group; X represents O, S or -NR