Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to remove -ve sign from the value -0.0 as 0.0

Dear friends,

Please help me out here. very urgent.

I have a year on year(YoY) set analysis expression which is giving me both +ve and -ve values.

But, some values are there as -0.001234567

So I customer wanted to see only up to two decimal places and when I do that these value is coming as -0.0

I wanted to show -0.001234567 as 0.0(need to remove negative sign)

I have tried with round(expression,0.1) but this is not giving correct result in all cases.

Please help.

Thanks,

SHAMLY P T

19 Replies
Not applicable
Author

Hi Sunny,

Below is my data table.

  Value in 1 decimal place

-0.0

-0.2

-0.6

  1. 2.5
  2. 0.0

Value Without Decimal Restriction

-0.012473807

-0.214963879

-0.657805517

  1. 2.544036204
  2. 0.037396728

My requirement is :-

  1. 1) The value should show only one decimal place
  2. 2) In situations like -0.012473807 when I reduce to one decimal place then the value will change into -0.0.
  3. 3) So, this should not happen. Customer wanted to see it as 0.0 instead of -0.0
  4. 4) I wrote =Num(If(Expression < -0.1, Expression , Ceil(Expression , 0.1)), '#.#') but customer didn’t agree to this as it is impacting the value holistically

Please help me with a best possible solution.

Thanks,

SHAMLY P T

sunny_talwar

4) I wrote =Num(If(Expression < -0.1, Expression , Ceil(Expression , 0.1)), '#.#') but customer didn’t agree to this as it is impacting the value holistically

I can only get you a result based on the information provided to me. Not sure what's the expectation? Can you provide where this isn't working?

raajaswin
Creator III
Creator III

Hi Shamly,

i think fabs() will work. It will give the absolute value.

fabs(your formulae)

will give positive value despite its negativity

Not applicable
Author

Hi,

You can use following Expression SUM(Round(YourExpression,0.1))

its_anandrjs
Champion III
Champion III

Hi,

Did you try

Fabs here

Ex:-

=fabs( -0.001234567)

Or

Fabs(Expression)

Or

Fabs(Field Name Here)

Regards
Anand

Not applicable
Author

Hi Anand,

In above case Fabs Function will not work as there will be customers who YOY will be negative.. and will give wrong analysis about customer YOY...

its_anandrjs
Champion III
Champion III

Then you can try with some combinations

Ex:-

=If( Field < 0 , fabs( Field name Here ), Field Name Here )

Regards

Anand

CarlosAMonroy
Creator III
Creator III

Hi,

Try fabs() or if you want to remove the -ve sign, go to object 'Properties', Number, and formatted with out the negative sign.

Thanks,

Carlos

Not applicable
Author

Thanks Aswin,

I need to show data in this way.

1) only one decimal place is enough.

2) No round of values. Values should show exact correct numbers

3) 0.0 should show as 0.0

4) 0.1 to infinity should show the same positive values

5) -0.1,-0.2,-0.13,-0.56 to -ve infinity should show as negative values

6) -0.01 should show as 0.0

7) -0.02 should show as 0.0

😎 -0.0003 should show as 0.0

9) -0.09 should show as 0.0 (should not round to 0.1)

10) -0.01 to -0.09 should show as positive values (0.0).

I have written,

Num(If(Expression < -0.09, Expression , fabs(Expression)), '#,##0.0')

But this is not working for all values from  -0.01 to -0.09

Not applicable
Author

You can try below expression

NUM(if(Expression > -0.09 and Expression< -0.01,0.0,Expression),'#,##0.0')