Skip to main content
Solved

Zero times 60 equals 60?

  • May 31, 2022
  • 2 replies
  • 41 views

louielou1234
Contributor
Forum|alt.badge.img+5

Hi There, I am reading from a csv column in which the hours and minutes are spelled out as a string, and I want to calculate the total minutes value. So I created a series of new columns in Attribute Manger and used some Regular expressions to isolate the components of the string. However, when I use the Multiply function against a zero value in the string, I do not get zero. And as we all know zero times any number should always equal zero. Any ideas what I am doing wrong? (I have attached my workbench for reference). THANK YOU!

Best answer by dustin

It's not that it's multiplying by 0, it's that some of your 'B' attributes do not have values. I would setup a conditional value for the 'C' attribute that looks like this screenshot. OR, you could use this expression which will return <null> for the entries without hours: @Evaluate(@Value(B)*60)image

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • May 31, 2022

It's not that it's multiplying by 0, it's that some of your 'B' attributes do not have values. I would setup a conditional value for the 'C' attribute that looks like this screenshot. OR, you could use this expression which will return <null> for the entries without hours: @Evaluate(@Value(B)*60)image


louielou1234
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • June 2, 2022

It's not that it's multiplying by 0, it's that some of your 'B' attributes do not have values. I would setup a conditional value for the 'C' attribute that looks like this screenshot. OR, you could use this expression which will return <null> for the entries without hours: @Evaluate(@Value(B)*60)image

Yes, that absolutely worked. Thank you so much!