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

InMonths Function

Hi,

Could anyone explain the below 2 scenarions of inmonths function.I dont understand y we are getting false in one expression and true in other expression.

inmonths ( 4, '2006-01-25', '2006-03-01', 0, 3 ) returns false

inmonths ( 4, '2006-04-25', '2006-03-01', 0, 3 ) returns true

Thanks in advance

2 Replies
sushil353
Master II
Master II

Hi,

here we will check if the 2006-01-25 lies in a 4 month period i.e

2006-03-01 to 2006-07-01

but here the first month of of year is March due to 3..

that is why you first expression is false and second one is true

Hope you understood..

Sushil

Andrea_Ghirardello

I agree, but why

inmonths ( 4, '2006-01-25', '2006-01-01', -1 ) returns false?

2006-01-01 with a shift of -1 and a period of 4 months contains 2006-01-25.