This can be achieve in two ways:
1) by using the resident / preceding load as M G mentioned.
2) you could have even used an inner join in the sql query itself.
LIB CONNECT TO 'DBPENDENCIA';
SQL SELECT B.NuContrato,
FROM dbo.TbEnvelope B inner join
dbo.TbContrato A ON B.NuContrato = A.Nucontrato.
WHERE A.DtContrato BETWEEN '20160101' AND '20160126';
The disadvantage of using the where exists approach in this scenario is that it executes in Qlik after all the records have loaded from the database, so you don't save yourself the time of loading all the records from the database.
But, if the load is relatively quick anyway you may use fewer resources of the database server by not performing the join in sql.