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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

convert date

how can i calculate this instruction:

1-1.1*(date_debut-date_fin)/date_fin as offf

the problem is in the date i couldn't convert it into a number.

1 Solution

Accepted Solutions
MarcoWedel

The question is what you like to achive with this calculation, as it will deliver nearly 1 for all contemporary timestamps.

hope this helps

regards

Marco

View solution in original post

18 Replies
Anonymous
Not applicable
Author

Try this:

1-1.1*(floor(num(date_debut))-floor(num(date_fin)))/floor(num(date_fin)) as offf

Anonymous
Not applicable
Author

Use num function to covert it into a number

1-1.1*(num(date_debut)-num(date_fin))/num(date_fin) as offf

Not applicable
Author

no it doesn't work, for exampl if

date_debut:17:26:19

date_fin:120:00:00

i must have 1,94,but when tried the functions that you suggested i've got: 3,65

MarcoWedel

The question is what you like to achive with this calculation, as it will deliver nearly 1 for all contemporary timestamps.

hope this helps

regards

Marco

Anonymous
Not applicable
Author

I don't recognize that date format. What are the 3 (:) delimited parts?

Not applicable
Author

Have you checked that the dates are represented correctly before you convert them into numbers?

Not applicable
Author

it's time not date hh:MM:SS

its_anandrjs
Champion III
Champion III

Try this way also

Load

1 - 1.1 * ( Date( date_debut ) - Date( date_fin ) ) / Date( date_fin ) as offf

From Location;


Regards

Anand

Jason_Michaelides
Partner - Master II
Partner - Master II

What kind of timestamp is "date_fin:120:00:00"?