Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

changing my -0% value to 0%(not fab)

Hi

I am getting a value -0 by using an expression and representing in the percentage format the actual value is 0.02 but showing in percentage it represents -0. so, I want to change it 0.

And I don't want to use fab function that doesn't fit my situation is there any thing around to do it

I have tried round function but its rounding the function before the percentage has been evaluated(in variable)

1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

How about this?

=if([your expression] < 0 and [your expression] > -0.5, 0, [your expression])

If you put your expression in a variable, this would then read:

=if($(eExp) < 0 and $(eExp) > -0.5, 0, $(eExp))

Should do the trick.  I used to be concerned about performance of having an expression multiple times like that, but I have been very reliably informed (thanks, Henric Cronström) that the caching in the QlikView engine will ensure that each number is only calculated once.

Hope that helps,
Steve

View solution in original post

15 Replies
ashfaq_haseeb
Champion III
Champion III

like this

=-0*-0

Regards

ASHFAQ

Not applicable
Author

That doesn't work because I have many values and if I do that all the values will become zero . This is percentage values and it can be negative but when I get 0 or -0 it should display 0 sa.png

Not applicable
Author

Keeping the thread live

juleshartley
Specialist
Specialist

Are you sure it's not a rounding issue? Try round([xx])...or you may need something like round([xx],0.01)

Not applicable
Author

No it's not rounding issue I have tried round function in a variable and then representing it in percentage so that doesn't work out because it is rounding the expression so it get the value that the expression has and its rounding that not as of the percentage. I need to calculate the percentage and then round it up 

juleshartley
Specialist
Specialist


Not sure I understand. Surlely a percentage is the same thing... just with 2 decimal places.

Not applicable
Author

if(sum(value)>-1 and sum(value)<=0,sum(value)*-0)



I can use expression like this but it causes performance issue I want an alternate way to sort it out

ashfaq_haseeb
Champion III
Champion III

As discussed

try the same in backend

Regards

ASHFAQ

Not applicable
Author

That doesn't workout in the back end