Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
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)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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..

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)