Contextual filter is not working I have views1 and view2, where in first view linked with view2 so I have given contextual filter in view both for entity reference field of view2. 

Now my problem is when I pass nid of view1 at Preview with contextual filters: it not retaining any data the contextual filter is not working.
So you just need to place 1 contextual filter for nid and one relationship with referenced entity, and use that relationship in fields. 
See the attached screenshot of a demo view.