Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
anitamanders
Contributor II
Contributor II

compare only completed months

Hello,

I want to make a compare between last three completed months and three months before of sales.

So eg. today I want to see sales of march-april-may 2018  compared to December 2017 -jan-feb 2018

therefore I have following functions:

=sum(if (InMonths (3, factdatum, Today(), 0), aantgefact))    but this gives data about april -may-june

=sum(if (InMonths (3, factdatum, Today(), -1), aantgefact)) this gives data about jan-feb-march

I want to exclude the current month (because data is not complete yet)

Can anyone help me out ?

3 Replies
Anil_Babu_Samineni

How about this?

Sum({<factdatum={">=$(=AddMonths(Max(factdatum),-3))<=$(=Max(factdatum))"}>} aantgefact)

And

Sum({<factdatum={">=$(=AddMonths(Max(factdatum),-6))<=$(=AddMonths(Max(factdatum),-3))"}>} aantgefact)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
anitamanders
Contributor II
Contributor II
Author

hello, no this doesn't  give me the correct data.

Also data changes when I select a productcode (one of the dimensions) so that is strange. Data should be the same.

What I need is now in june:

data from march april may

compared to data from December January February

And on first of july this should automaticly change to data april may june compared to januari February march

etc etc.

Anil_Babu_Samineni

I am not sure - I understand your request..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful