How can I get the absolute of a number?

Diogo Thomaz shared this question 9 months ago
Answered

I need a simple function: ABS. How can I get this in YF?

Thanks

Comments (6)

photo
1

Hi Diogo,

Thanks for contacting support!

Absolute is not an existing function in Yellowfin but you could use a calculated field to get the same effect.

The formula would be something like

If x =< 0 then x* -1 else x

I hope that helps!

Kind regards,

Chris

photo
1

Hello Chris,

Thank you for your reply. It is clear.

I also need the integer part of a decimal number. For example, if the value is 82.16 I want the 82. I need this to use in a formula so it is not just a matter of formatting. Any suggestions?

Diogo

photo
1

Hi Diogo,

You could use freehand SQL in a view or report to try that. There's some information on data type casting here How to Use CAST Data-Type Conversions with SQL - dummies

I hope that helps!

Kind regards,

Chris

photo
1

Hi,

I know we've got ticket open at the moment and I hope your week has been going well.

Just wanted to check-in and see how it's all going. Was there anything you were needing from me to help get this particular problem resolved?


Regards,

Chris

photo
1

Hello Chris,

This has been resolved, thanks.

Best regards,

Diogo

photo
1

Hi Diogo,

That's no worries! I'll go ahead and close it off.

Kind regards,

Chris