The present invention relates to a fused heterocyclic derivative of the formula (I) The variables R1-R4, z, A, Q, X and Y are as defined in the claims. The following heterocycles are exemplified sub-structures of formula (I): The compounds of formula (I) are modulators of the S1P receptor (Sphingosine-1-phosphate receptor), More specifically, they are agonists of S1P5. The compounds have therapeutic use in treatment of cognitive disorders, age-relate cognitive decline and dementia.