You probabaly need to format the variables, since the variable as such is a decimal value and not a "Year" or "Month" value.
When working with dates always keep in mind that you are working with Dual values, where calculation is done on the numeric value and presentation with the textual value. This is why you often need to use for example Date(Date#()) to alter both the numeric and textual value of the variable or field.
Erich solution likley works very well, but in the long run you will be better of getting in control of and using the date/time functions that qlikview provide as these open up possibilites to do more efficient calculations with dates and timestamps.
An other possibility is that your data is not properly formatted in the table, meaning that year for example is not a integer value but has decimal value as well. This is easier to evaluate if you can provide a smaple of your QVW.
You could use num(vLastMonth) and num(vLastYear) to see the exact numeric value of the variables. Then follow it up by adding a list boxes with Num(AnoEmissao) and Num(MesEmissao) so that you can confirm that the values you are trying to apply really exist. This should also reveal to you if your table have solid integer, decimal och even textual values.
It's better if you compare date fields on set analysis using numbers.
On your script I would create another field called nMesEmissao
The sintax will be
num(Month(DataEmissao))) as nMesEmissao
vLastMonth= num( Month(Max(DataEmissao)) )
Feb = 2 and so on...
This might solve your set analysis problem.
Hope it helps,