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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

logarithm of Zero

Hi guys,

Can you please help me. I don't understand why qlikview returns 1 instead of 0, if I write experssion =if(isnull(log(0)),0,1)?

Thank you.

1 Solution

Accepted Solutions
Not applicable
Author

try the below

 

=replace(text(num(log(0))),'-1.#INF',0)

View solution in original post

10 Replies
Not applicable
Author

i think that it is because log(0) returns -1,#INF, so that's not null, try with '-1,#INF' instead of isnull()

if(log(0)='-1,#INF',0,1)

Reggards,

Santiago

Not applicable
Author

Thanks for response, but it doen't work in my app. Maybe I should mark some option somewhere?

Sokkorn
Master
Master

Hi,

Log(0) return -1,#INF mean that it have value. It not null. So the expression you used return 1 is correct. If you wish to return 0 then you can try =If(Not IsNull(Log(0)),0,1)

Regards,

Sokkorn

Not applicable
Author

It's =if(log(0)='-1,#INF',0,1) exp. looks good but doesn't work. In my task i have to check one big expression in log which sounds like as if Log (value) returns existing value than 1, otherwise 0.

=Log(0) has value '-1,#INF', but expression returns '-' not 0.

Not applicable
Author

Most probably is that your expression don´t given back 0 to be evaluated at log(), So please add yor expression on qvw or here, then we can check if there´s anything wrong.

Regards,

Santiago.

Not applicable
Author

You can see .qvw in attachment before. I used your 'IF' statement

Not applicable
Author

try the below

 

=replace(text(num(log(0))),'-1.#INF',0)

Not applicable
Author

Hi , look if this work for you, be care that 'Supress zero values' wasn't clicked on presentation tab.

Regards.

Santiago

Sokkorn
Master
Master

Hi,

Use this in your text object =If(WildMatch(Log(0),'*#INF*'),0,1)

Regards,

Sokkorn