Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Nombre d'heures entre deux dates

Bonjour à tous,

Je souhaiterais calculer le nombre d'heure qui s'est écoulé entre deux dates.

date_creation_hdate_prise_charge_h
02/01/2014 23:1406/01/2014 09:37
03/01/2014 16:2406/01/2014 09:35
09/01/2014 03:3209/01/2014 09:56
11/01/2014 01:0513/01/2014 10:11
15/01/2014 07:1115/01/2014 09:44
16/01/2014 16:4216/01/2014 18:11

Dans mon script au chargement j'ai essayé :

Dans mon main :

SET TimeFormat='hh:mm';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm';

Au chargement de mes donnée

Time(([Date clôture  ] - [Date de prise en charge  ]),'hh:mm') as tps_traitement

Mais cela ne me donne pas le bon résultat, si quelqu'un à une idée!

Merci d'avance

1 Solution

Accepted Solutions
maxgro
MVP
MVP

LOAD

date_creation_h, date_prise_charge_h,

interval(date#(date_prise_charge_h, 'DD/MM/YYYY hh:mm') - date#(date_creation_h, 'DD/MM/YYYY hh:mm'), 'hh') as h1,

date#(date_prise_charge_h, 'DD/MM/YYYY hh:mm') - date#(date_creation_h, 'DD/MM/YYYY hh:mm') as h2

FROM [http://community.qlik.com/thread/135170] (html, codepage is 1252, embedded labels, table is @1);

you can format in number tab h2

View solution in original post

2 Replies
maxgro
MVP
MVP

LOAD

date_creation_h, date_prise_charge_h,

interval(date#(date_prise_charge_h, 'DD/MM/YYYY hh:mm') - date#(date_creation_h, 'DD/MM/YYYY hh:mm'), 'hh') as h1,

date#(date_prise_charge_h, 'DD/MM/YYYY hh:mm') - date#(date_creation_h, 'DD/MM/YYYY hh:mm') as h2

FROM [http://community.qlik.com/thread/135170] (html, codepage is 1252, embedded labels, table is @1);

you can format in number tab h2

Anonymous
Not applicable
Author

Thank you very much !