15 Replies Latest reply: Oct 7, 2014 11:02 AM by bhanu k

# 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)

• ###### Re: changing my -0% value to 0%(not fab)

like this

=-0*-0

Regards

ASHFAQ

• ###### Re: changing my -0% value to 0%(not fab)

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

• ###### Re: changing my -0% value to 0%(not fab)

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

• ###### Re: changing my -0% value to 0%(not fab)

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

• ###### Re: changing my -0% value to 0%(not fab)

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

• ###### Re: changing my -0% value to 0%(not fab)

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

• ###### Re: changing my -0% value to 0%(not fab)

As discussed

try the same in backend

Regards

ASHFAQ

• ###### Re: changing my -0% value to 0%(not fab)

That doesn't workout in the back end

• ###### Re: changing my -0% value to 0%(not fab)

Can you share sample data with expected output

Regards

ASHFAQ

• ###### Re: Re: changing my -0% value to 0%(not fab)

I don't want if condition to be written in my app as there are too many so that there is a performance issue

• ###### Re: changing my -0% value to 0%(not fab)

Something like this? not sure if it will work

=Sum({<sum(value)={">-1<=0"}>}(value)*-0)

• ###### Re: changing my -0% value to 0%(not fab)

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, hic) that the caching in the QlikView engine will ensure that each number is only calculated once.

Hope that helps,
Steve

• ###### Re: changing my -0% value to 0%(not fab)

Why doesn't

=round(sum([Value]),0.01)

work?

• ###### Re: changing my -0% value to 0%(not fab)

Because I am evaluating my variable in the backend and then evaluating the expression so the round function will work in the back end