[Problem]To provide a GPR40 activating agent having, as an active ingredient, a novel compound having a GPR40 agonist action, a salt of the compound, a solvate of the salt or the compound, or the like, particularly, an insulin secretagogue and a prophylactic and/or therapeutic agent against diabetes, obesity, or other diseases.[Means of solving the problem]A compound of Formula (I):(where p is 0 to 4 j is 0 to 3 k is 0 to 2 a ring A is a specific cyclic group a ring B is a benzene ring, a pyridine ring, or a pyrimidine ring X is -CH2-, O, -S(O)i- (i is 0 to 2), or -NR7- R1 to R6 are specific groups),a salt of the compound, or a solvate of the salt or the compound.