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: 
soniasweety
Master
Master

display days

Hi all,

\

I am calculating the days     but am getting the wrong out output

11 Replies
Frank_Hartmann
Master II
Master II

Load *,

num(Date#('07/19/2017','MM/DD/YYYY'))-num(Date#(OpenDate,'MM/DD/YYYY')) as [Open Days]

num(Date#('07/19/2017','MM/DD/YYYY'))-num(Date#(Update Time,'MM/DD/YYYY')) as [Last Updated Days]

Anil_Babu_Samineni

If [Open Date] is the format of DD/MM/YYYY then try like below

MakeDate(2017, 07, 19) - Date([Open Date], YYYY-MM-DD) as [Open Days],

MakeDate(2017, 07, 19) - [Update Time] as [Last Updated Days];

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
pathiqvd
Creator III
Creator III

convert '7/19/2017' to date format

Data:

Load *, Date(date#('7/19/2017','MM/DD/YYYY'))-[Open Date] as [Open Days],

  Date(date#('7/19/2017','MM/DD/YYYY'))-[Update Time] as [Last Updated Days];

soniasweety
Master
Master
Author

its not working same result came 

Anil_Babu_Samineni

My expressions may frequent to you. Will you check?

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
soniasweety
Master
Master
Author

this is also not giving anil

Anil_Babu_Samineni

May be share sample data in excel?

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
Anonymous
Not applicable

Try using this expression

LOAD

     Open_Date,

     Update_Date,

     DayNumberOfYear(Date('01/03/2017','DD/MM/YYYY') - Date(Open_Date,'DD/MM/YYYY')) as Open_Days

FROM

You_Table

Hope This helps.

pathiqvd
Creator III
Creator III

Data:

Load *,

Date(date#('7/19/2017','MM/DD/YYYY'),'MM/DD/YYYY')-Date([Open Date],'MM/DD/YYYY') as [Open Days],

  Date(date#('7/19/2017','MM/DD/YYYY'),'MM/DD/YYYY')-Date([Update Time],'MM/DD/YYYY') as [Last Updated Days];