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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Akina0929
Creator
Creator

not considering join date and relieve date?

HI good morning all,

             I have calculated difference between two dates using following formula

date(Date(releavedate,'DD-MM-YYYY')-Date(joindate,'DD-MM-YYYY'),'DD') AS dtime


it's not considering  join date and  releave date it has to calculate that days also please help me

Thanking you,

8 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

I think what you are after is:

Interval(Date#(releavedate,'DD-MM-YYYY') - Date#(joindate,'DD-MM-YYYY'), 'DD') AS dtime

Date# is the function that interprets a string and returns a date value. Date(..., 'DD') formatting will return the day of the month. I assume you want the number of days, so use Interval instead of Date for the outer formattng function.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anil_Babu_Samineni

Why not simple Interval(releavedate-joindate,'DD') as dtime

And make sure to use the Date format environment should be your date format

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
Akina0929
Creator
Creator
Author

HI Anil ,

It's also showing one day less please check the attached image. !

Anil_Babu_Samineni

Can you post the data on wall

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
Akina0929
Creator
Creator
Author

Hi Anil,

please check the attached image.

Anil_Babu_Samineni

I am expecting Data like below

Date1, Date2

01-02, 03-03

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
Kushal_Chawda

try this

releavedate - joindate+1 AS dtime

Akina0929
Creator
Creator
Author

HI anil,

   I am sending example data please find.

Thanking you,