Need suggestion to use URL variable in Query

i have 2 dashboard D1 and D2 . When click on one cell in D1 then its opening new tabs for dashboard D2.

D2 URL look like as below :

I want to use *var-host=M2R_DFANE_SNP_DEMETER_EQTY * in QUERY which changing for each cell.

Kindly suggest.