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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression definition with dates

Hi Community, im trying to resolve the following expression.

I have this table

productoptime_starttime_end
A1228:3017:30
B1239:0011:00
C12411:2013:50
D12513:4014:10

what i need is the PROM value (in hours) between all time_end and time_start, columns, in this case:  

A --> 9 hours

B --> 2 hours

C --> 2,5 hours

D --> 0,5 hours

PROM: 3,5 hours

thanks

gerardo

18 Replies
Not applicable
Author

I have example for you.

I hope that it helps.

regards

Darek

its_anandrjs
Champion III
Champion III

Take

Dimension:- Product

Expression:- time(time_start-time_end)

Not applicable
Author

Sorry Dariusz, i couldn't open the file.

Could you please write the expression here?

thanks

Not applicable
Author

script:

LOAD product,

     op,

     time_start,

     time_end

FROM

(ooxml, embedded labels, table is data);

dimension: product

expression:

Time( sum(time_end-time_start))

Not applicable
Author

Hi Anand, the problem is that i need to select at least one OP value. If i select only a Product the value is null.

thanks

Not applicable
Author

Thanks for your answer Dariusz, the problem is that i need to include the dimension Product in the expression, if not some times the value is NULL. For example when no values (products or op) are select.

is it clear?

thanks

Not applicable
Author

This is why you should always share your sample data with those kind of questions....

Not applicable
Author

if you remove the dimension product in your example, this expression works?

Not applicable
Author

now it works