Disclosed are a GPR40 activator, particularly an insulin secretion promoter, and a prophylactic and/or therapeutic agent for diabetes, obesity, etc. each containing, as an active ingredient, a novel compound having a GPR40 agonistic activity or a salt thereof or a solvate thereof, or the like. Also disclosed is a compound represented by formula (I) or a salt thereof, or a solvate thereof. In formula (I), p represents 0 to 4; j represents 0 to 3; k represents 0 to 2; the ring A represents a specific cyclic group; the ring B represents a benzene ring, a pyridine ring, or a pyrimidine ring; X represents -CH-, O, -S(O)- (i represents 0 to 2), or -NR-; and R to R each independently represent a specific group.