Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
dinicholls
Creator II
Creator II

How do I say, within the month?!

Hi,

I'm working on an expression, and want to say that if the due date is within then current month, then yes else no.

Would it be this?

if ([Due Date] = Month(Today()), 'Yes', 'No')  as [Due This Month]

Or am I nearly right, just not quite there?! Story of my life! lol

Ta

Di

1 Solution

Accepted Solutions
Not applicable

Hi,

If(Month([Due Date])=Month(today()),'Yes','No')

or else

If(Match(month([Due Date])=Month(today()),'Yes','No')

View solution in original post

3 Replies
Not applicable

Hi,

If(Month([Due Date])=Month(today()),'Yes','No')

or else

If(Match(month([Due Date])=Month(today()),'Yes','No')

hic
Former Employee
Former Employee

Almost... If you use

     if (Month([Due Date]) = Month(Today()), 'Yes', 'No')  as [Due This Month]

you will check that the months match. But you will also get a match on November last year with November this year. Then it might be better to use

     if (MonthStart([Due Date]) = MonthStart(Today()), 'Yes', 'No')  as [Due This Month]


HIC


Not applicable

Diane,

some functions migth be helpful  - check help

InMonth (date, basedate , shift)

returns true if date lies inside the month containing basedate. The month can be offset by shift. Shift is an integer, where the value 0 indicates the month which contains basedate. Negative values in shift indicate preceding months and positive values indicate succeeding months.

Examples:

inmonth ( '2006-01-25', '2006-01-01', 0 ) returns true

inmonth ( '2006-01-25', '2006-04-01', 0 ) returns false

inmonth ( '2006-01-25', '2006-01-01', -1 ) returns false

inmonth ( '2005-12-25', '2006-01-01', -1 ) returns true

InMonthToDate (date, basedate , shift)

returns true if date lies inside the part of month containing basedate up until and including the last millisecond of basedate. The month can be offset by shift. Shift is an integer, where the value 0 indicates the month which contains basedate. Negative values in shift indicate preceding months and positive values indicate succeeding months.

Examples:

inmonthtodate ( '2006-01-25', '2006-01-25', 0 ) returns true

inmonthtodate ( '2006-01-25', '2006-01-24', 0 ) returns false

inmonthtodate ( '2006-01-25', '2006-02-28', -1 ) returns true

best regards

chris