it appears your month is not a date but a number. that would have been a great info to have. i would suggest you use a real date as your solution is not scalable. if this were a real date you wouldnt need to test for year.
Thank you for the explanation, Edwin...sorry, but I wasn't clear enough in my question: I already have the availability of the reference year (AnnoCompetenza) and the reference Month (MeseCompetenza), but I'm not able to get the correct syntax for the set analysis to sum the Qty (QtaAcquistata) for the current month and the further two in the previous year (in this moment may/jun/jul 2021, but it has to roll, of course) for each article.
i would think that there is something else going on, Qlik is saying it doesnt recognize the fieldnames, eithere there is some other text outside the window or the field names are not correctly (case wise). copy paste the bottom of the editor where Qlik interprets the expression. pay attention to the format of the evaluated $()