Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MONTH DIFFERENCE

Start Date  End Date       Desired Column Values(how to accomplish this difference on no of months between 2 Dates)

3/01/2014   6/01/2014            3

3/01/2014   7/01/2014            4

3/01/2014   8/01/2014            5

3/01/2014   9/01/2014            6

3/01/2014   10/01/2014          7

4 Replies
qlikview979
Specialist
Specialist

Hi

Try like this

LOAD Startdate,

           Enddate,

           Round(num(Interval(Enddate-Startdate))/30) as check

FROM

(ooxml, embedded labels, table is Sheet1);

prma7799
Master III
Master III

Please try this

Test:

LOAD * Inline

[

StartDate, EndDate

'3/01/2014'   ,'6/01/2014'        

'3/01/2014'   ,'7/01/2014'        

'3/01/2014'   ,'8/01/2014'        

'3/01/2014'   ,'9/01/2014'        

'3/01/2014'   ,'10/01/2014'  

];   

NewTest:

LOAD * ,  (date(date#(EndDate,'DD/MM/YYYY'),'DD/MM/YYYY')) -  (date(date#(StartDate,'DD/MM/YYYY'),'DD/MM/YYYY')) as Diff

Resident Test;

DROP Table Test;

PFA another Solution

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can find the solution in this doc

Calculating Months difference between two dates

Help users find answers! Don't forget to mark a solution that worked for you!
Anonymous
Not applicable
Author

write this expression:

=Day(Interval(Date#(EndDate,'DD/MM/YYYY')-Date#(StartDate,'DD/MM/YYYY')))+1

interval.jpg