It sounds like you want to use the Intervalmatch function. But I'm not going to download 25MB to find out and the example you posted isn't clear about what kind of data you're working with. So, have a look at this blog post: IntervalMatch. If that's not what you need please post a small qlikview document that illustrates the problem.
Hi Gleybson, set analisys and $-expansion is calculated before the table, so it will not affect row by row, you can check the difference removing the header of the expression and showing how it changes when you filter by a cod.
You can use Aggr() or If to apply conditions row by row, something like:
and ID_CALENDARIO<=ID_ANIVERSARIO_CONTRATO_BENEFICIARIO_FIM, FATURAMENTO.VALOR))
// (It's just an example)
But in your model gets complicated because the expression involves different tables and the comparisons gives strange results... I'm not sure why but i would try to have all the 'filter' fields in the CARTEIRA table and check if works better.