Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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)

Tags (3)
1 Solution

Accepted Solutions
MVP
MVP

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

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

15 Replies

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

like this

=-0*-0

Regards

ASHFAQ

Not applicable

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 sa.png

Not applicable

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

Keeping the thread live

juleshartley
Valued Contributor

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)

Not applicable

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 

juleshartley
Valued Contributor

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.

Not applicable

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

Not applicable

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

That doesn't workout in the back end

Community Browser