Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

MonthStart & Today() - Substracting days

Hi all

I hope someone can help me.

I have below expression, where I'm trying to substract XX numbers of days from MonthStart of Today().

However it doesn't return the correct amount. It seems like it's including to many days.

Sum({$<BOOKING_DATE = {">=$(=MonthStart(TODAY() - 16)) <=$(=MonthStart(TODAY())))"}>} NET)


So basically I'm trying to get this date range e.x [15-09-2017] - [01-10-2017].



Thanks.


Regards

Stefan

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Does this works?

Sum({<BOOKING_DATE = {"=BOOKING_DATE >= MonthStart(Today())-16 AND BOOKING_DATE <= MonthStart(Today())"}>} NET)


Note - Make sure about Date format for BOOKING_DATE and Today(). Try to check using text box..

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

View solution in original post

4 Replies
Anil_Babu_Samineni

Does this works?

Sum({<BOOKING_DATE = {"=BOOKING_DATE >= MonthStart(Today())-16 AND BOOKING_DATE <= MonthStart(Today())"}>} NET)


Note - Make sure about Date format for BOOKING_DATE and Today(). Try to check using text box..

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
RonaldDoes
Partner - Creator III
Partner - Creator III

MonthStart(TODAY() - 16)


will do just that, give you the MonthStart for the date 16 days ago (so for the first 16 days of the month, the monthstart of the previous month, and from the 17th of each month, just the montstart of the current one).

What you want here is:


MonthStart(Today())-16
Anonymous
Not applicable
Author

Hi Anil

That was "easy".

And yes it works perfectly.

Thanks a lot.

Anonymous
Not applicable
Author

Hi Ronald

Yes of course. That makes sense. It's all about the parenthesis.

Thanks for the answer. I will keep that in mind.