Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
NickP_DF
Creator II
Creator II

Set analysis for scrollin previuos year and three month

Hello guys,

I need to extract the bought quantity for the last year in the current month and in the further two (now it should be may/jun/jul 2021)

I've set the formula for the previous year, but I need some help with the second condition:

=Num(Aggr(Sum({<AnnoCompetenza={"$(=Year(Today())-1)"}>} QtaAcquistata), CodArticolo),'#.##0') 

Could someone help me, pls?

Thanks.

N. 

Labels (1)
14 Replies
NickP_DF
Creator II
Creator II
Author

Hello Edwin,

now the formula is correct but, as I wrote,  I haven't the date to compare, but only the Month and the Year: is it possible to use them into the formula instead of the data?

Thanks.

N.

NickP_DF
Creator II
Creator II
Author

Got it!

=Sum({<AnnoCompetenzaACQ={"$(=Year(Today())-1)"}, MeseCompetenzaACQ={">=$(=Num(Month(Today())))<=$(=Num(Month(Today()))+2)"}>} QtaAcquistataStorica)

 

Thank you for the support :-).

N.

edwin
Master II
Master II

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.

good you solved your issue.

NickP_DF
Creator II
Creator II
Author

Yes, Edwin, you're right. I apologize if I wasn't clear enough about the month; however, your solution could be very useful for me when I'll have a date and not a month.

Thank you so much!

N.

edwin
Master II
Master II

np glad it somehow helped