Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
soniasweety
Valued Contributor III

display days

Hi all,

\

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

11 Replies
Frank_Hartmann
Honored Contributor II

Re: display days

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]

Re: display days

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];

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
Contributor III

Re: display days

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
Valued Contributor III

Re: display days

its not working same result came 

Re: display days

My expressions may frequent to you. Will you check?

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
Valued Contributor III

Re: display days

this is also not giving anil

Re: display days

May be share sample data in excel?

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)
laxmikuber
Contributor II

Re: display days

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
Contributor III

Re: display days

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];