Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert negative values to postive

Hi

How can i convert a measure which is displaying as all negatives to positive vales?

Thanks

20 Replies
maxgro
MVP
MVP

example

from qlik online help

fabs(x)

The absolute value of x. The result is a positive number.

Examples:

fabs( 2.4 ) returns 2.4

fabs( -3.8 ) returns 3.8

1.png

Anonymous
Not applicable
Author

can you share some dummy data?

senarath
Creator III
Creator III

Hi,

IF you use *-1, your positive amounts may convert into negatives. So if your data is not 100% negatives, pls use fabs()

thanx

hannan_t
Partner - Contributor III
Partner - Contributor III

Try using the FABS function. It will surely resolve the issue.

e.g

fabs(Amount)

Not applicable
Author

should i use the fab function in the script or in the expression?

ashfaq_haseeb
Champion III
Champion III

Hi,

have a look at my reply.

Regards

ASHFAQ

maxgro
MVP
MVP

you can use fabs

- in script

- in chart

Not applicable
Author

thanks.  So could i say for example use the following:

Fab (Income) as Income

ashfaq_haseeb
Champion III
Champion III

Hi,

Sure you can use that

Regards

ASHFAQ

PrashantSangle

Hi,

Its FABS(FieldName) as New_fieldName

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂