Post

5 followers Follow
0
Avatar

Convert field type duration

Is it possible to convert the field type duration to a float of hours?

I want to do this: Work (duration field) * 100 euro / hour = xxxx euro 

But for this, I have to convert my duration field to a float value.

 

Bert Pattyn Answered

Please sign in to leave a comment.

7 comments

0
Avatar

Apparently that does not work because the first parameter of Hours needs to be of the Numbers type.

Bert Pattyn 0 votes
Comment actions Permalink
0
Avatar

To convert a duration to a number, you just need to normalize it by dividing by 1d ( $Duration / Days(1) ).  So I think Hours(Duration Field / Days(1)) should work.

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

Thx Josh. This did the trick!

$C_Duration/ Hours(1) * 100

Bert Pattyn 0 votes
Comment actions Permalink
0
Avatar

I'm trying to apply this logic on a report formula column & receiving an error: Error: Function Days() can be used only in calculated field.  I see that this post was from a couple of years ago, so maybe it works differently now??

Susan Shevelenko 0 votes
Comment actions Permalink
0
Avatar

Instead of creating a formula column in a report, do you have enough customizations available to create a custom field based on a formula? You would be able to easily pull this field into your reports as well as your views outside of reports.

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

Hi Susan,

 

Days() and Hours() functions are currently not available in the context of calculated fields in reports. It is only available on custom fields. We have an internal CR (CR-295076). 

Please submit your post here: https://success.clarizen.com/hc/en-us/community/topics/200269468-Share-Your-Ideas-Suggestions to get updates when that CR is rolled out.

 

In the meanwhile, you can create a custom field and leverage that in the report level (if you are not a Clarizen admin, please contact your Clarizen Administrator).

 

Good luck!

Tamir

Tamir Avital 0 votes
Comment actions Permalink