Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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];

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
soniasweety
Master
Master
Author

this is also not giving anil

Anil_Babu_Samineni

May be share sample data in excel?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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];