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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Difference

I have a Two Column Date of Joining and Date of Resignation ...

Example :Date of Joining - 01/01/2012  And  Date of Resignation - 02/05/2015

so i want the Out Put how many Year Month and Day Employee works.. like .. 3 year 4 Month and 1 Day ...


Plz Tell me

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

Load *,Floor(Days/365) & ' Years ' & Floor(Mod(Days,365)/30) & ' Months ' & Mod(Mod(Days,365),30) & ' Days ';
Load *,Interval(DOR-DOJ,'DD') As Days;
lOAD *
FROM
ExcelDemo.xlsx
(
ooxml, embedded labels, table is Sheet1);

View solution in original post

23 Replies
Not applicable
Author

Hi Brijesh,

have a look at the interval function, this should help you in creating this

Joe

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi,

Can u share Sample file to better understand ?

Regards,

Nagarjuna

tyagishaila
Specialist
Specialist

You can try it,

Day(EndDate)- Day(StartDate)

Month(EndDate)- Month(StartDate)

Year(EndDate)- Year(StartDate)

sujeetsingh
Master III
Master III

Use Interval() function of Qlik

anbu1984
Master III
Master III

Load *,Floor(Days/365) & ' Years ' & Floor(Mod(Days,365)/30) & ' Months ' & Mod(Mod(Days,365),30) & ' Days ';
Load *,Interval(DOR-DOJ,'DD') As Days;
lOAD Date#(DOJ,'DD/MM/YYYY') As DOJ,Date#(DOR,'DD/MM/YYYY') As DOR Inline [
DOJ,DOR
01/01/2012,02/05/2015 ]
;

Not applicable
Author

Thanks Anbu

can u as well help me in your code if i have DOJ column and DOR column...

Load *,Floor(Days/365) & ' Years ' & Floor(Mod(Days,365)/30) & ' Months ' &Mod(Mod(Days,365),30) & ' Days ';
Load *,Interval(DOR-DOJ,'DD') As Days;
lOAD Date#(DOJ,'DD/MM/YYYY') As DOJ,Date#(DOR,'DD/MM/YYYY') As DOR Inline [
DOJ,DOR
01/01/2012,02/05/2015 ]
;

so instead of writing date 01/01/2012,02/05/2015 ]; what i need to write..

so sry ,,i m new in qlikview so i m getting doubt..

Not applicable
Author

But how to write code.. i have a data like

Date of Joining      Date of Resignation                  Total Number of Period Person worked

01/02/2012              05/06/2014

04/12/2011               06/01/2015

i want to Out put to show like total Period worked i.e 3 Year 6 Month 4 day...

Not applicable
Author

But how to write code.. i have a data like

Date of Joining      Date of Resignation                  Total Number of Period Person worked

01/02/2012              05/06/2014

04/12/2011               06/01/2015

i want to Out put to show like total Period worked i.e 3 Year 6 Month 4 day...

anbu1984
Master III
Master III

What is your input? Excel or Database?