Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sculptorlv
Creator III
Creator III

How to get data from period - this month

Hello! Hope for your help again.

I have columns "Posting_date" and "Sales".

How can I get all "Sales" values from current month?

                        

I need to replace IF value "Bouth__PostingDate > Today()- 15" in the following sentence :

= SUM(   IF(PostingDate > Today()- 15, Sales, 0) )

Because - 15 is ok only, if we have 15.12.2015 date today. How can I make it ok for all TODAY dates?

Thank you in advance.

12 Replies
sculptorlv
Creator III
Creator III
Author

Find answer for my additional question.

I used this function:

=sum(

IF(InMonth(Bouth__PostingDate,Today(),0),Bouth_Cofee_Item_Money,0)) for this month

IF(InMonth(Bouth__PostingDate,Today(),-1),Bouth_Cofee_Item_Money,0)) for previous month

IF(InMonth(Bouth__PostingDate,Today(),-2),Bouth_Cofee_Item_Money,0)) for ex previous month etc.

Anonymous
Not applicable

if you want to subtract month then do like this:

Assume DateField is having Today's date

=addmonths(month(DateField), -1)    //would return November month

=addmonths(month(DateField), -2)    //would return October month


=addmonths(month(DateField), -3)    //would return September month


and so on...

sculptorlv
Creator III
Creator III
Author

OMG!! So simple.. got stupid!

Thank you.