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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date difference in separate field

Hi,

I have two fields Date Sent and Received

I want the difference of two fields in an another field say "Difference"

i.e Date Sent - Date Received = Difference

So that i can use the difference field in another chart as an expression.

I want the difference as number of days.

I have attached the Date.qvw.

Thanks in advance,

Keerthi

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

May be like attached sample?

PFA

View solution in original post

13 Replies
Anonymous
Not applicable
Author

If the format of the fields is date , then you can simply subtract them and get the difference,

I format is not right the make those fields in date format by date, date \# or makedate functions and then substract them..

Regards

Nitin

Not applicable
Author

Hi Keerthi,

(Date Sent - Date Received) didnt worked?

Not applicable
Author

you Can use "Interval" function for this purpose

try it you will Succeed

Not applicable
Author

In scripting or Back end

Interval(Date Sent - Date Received)  as  Difference

Not applicable
Author

hi,

Use This Expression,

=sum(num(ows_DateSentToUnderwriter)-num(ows_DateReceivedAon))

Not applicable
Author

In scripting or Back end


Interval(Date Sent - Date Received, D hh:mm:ss)  as  Difference


this will give you in Days

qlikpahadi07
Specialist
Specialist

you can simple write  ows_DateSentToUnderwriter - ows_DateReceivedAon in your script.

Anonymous
Not applicable
Author

if your date that is sent and recevied are in format MM/DD/YYYY

just check this script it gives correct diffrence in no of days.

a:

load * Inline

[

sent,received

1/1/2013, 9/2/2013

2/1/2013,  11/1/2013

];

LOAD Date(received) - Date(sent) as daydiff

    

    

  

resident a;

DROP Table a;

anant

Not applicable
Author

u can try the below in straight table :

Dimension:

Col1 -> ows_DateSentToUnderwriter

co2 -> ows_DateReceivedAon

Expression:

ows_DateSentToUnderwriter - ows_DateReceivedAon