Don't show if a negative number.

Looking at the image below, I have a negative number (in the red box) which refers to how many hours over 9 hours I have worked on that particular day and is formatted as DURATION. Below the day of the week for that column is how many hours I will be paid for which is also set as DURATION.

I have tried various ways of only showing the column I mentioned first ONLY if its a positive duration but I'm having no luck at all.

The formula I'm using is ([Paid Hours]-"9") which is very basic. I've tried a show if using the formula in the second image below but it gives an error.

Any suggestions?

Screenshot 2024-11-04 at 17.03.46.pngScreenshot 2024-11-04 at 17.10.53.png

Solved Solved
0 8 297
1 ACCEPTED SOLUTION

Steve
Platinum 5
Platinum 5

@Simon_Blackburn wrote:

The formula I'm using is ([Paid Hours]-"9")


IFS(
  ("009:00:00" < [Paid Hours]),
    ([Paid hours] - "009:00:00")
)

View solution in original post

8 REPLIES 8

Write in the ShowIf property:

IF(

[duration] >= 0, true, false

)

Another option is to calculate the value of paid hours based on a check, for example, if duration is less than zero then set it to zero, otherwise set it to the duration value.

You can create an expression like this:

IF(

[PaidHours] - 9 < 0, 0,

[PaidHours] - 9

)

Screenshot 2024-11-04 at 18.29.20.pngThis is the only way I can get the formula to correct but it doesn't do anything at all to the negative number, it remains.

Ok, try like this:

IF(      

         TOTALHOURS(

                                         [PaidHours] - 9

                                     ) < 0,

        0,

         [PaidHours] - 9

   )

 

TOTALHOURS() 

I get the following error:

IF function is used incorrectly:the second input (value-if-true) and third input (value-if-false) should have the same type.

Steve
Platinum 5
Platinum 5

@Simon_Blackburn wrote:

The formula I'm using is ([Paid Hours]-"9")


IFS(
  ("009:00:00" < [Paid Hours]),
    ([Paid hours] - "009:00:00")
)

Thanks @Steve 

Perfect. Thank you @Steve and also thank you @Gustavo_Eduardo for trying and educating me.

I'm learning too, my friend! Some expressions that I don't use frequently, for example this one, are good to learn. Greetings

Top Labels in this Space