
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Divide by zero
Hello experts,
I have expressions like this
count(DISTINCT{$<[Page2]={'www:cart:cloud:product'},[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0}>} [Visitor ID])
and it is calculating zero and want to use value as in denaminator (i.e a/b). If i use this value it is giving blank, but i want to display one message.
Pls help me on this.
Thanks in advance.
Regards,
kumar
- Tags:
- qlikview_scripting
Accepted Solutions

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Use Alt() like below
=Alt(Expression, 'Value If expression returns null')
Example:
=Alt(100/0, 'N/A')
Hope this helps you.
Regards,
Jagan.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can write a expression like
if(count(DISTINCT{$<[Page2]={'www:cart:cloud:product'},[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0}>} [Visitor ID]) =0,'message',<expression>)
or simple
if(len(a/b>1,a/d,'Message')
you can use Null functions too instead of Len


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try Alt function
having
Alt(count(DISTINCT{$<[Page2]={'www:cart:cloud:product'},[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0}>} [Visitor ID]),0)
This should return the count if its a valid number otherwise 0
maybe you could have different aggregation over different selection instead of returning zero
Regards
Ziad

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Use Alt() like below
=Alt(Expression, 'Value If expression returns null')
Example:
=Alt(100/0, 'N/A')
Hope this helps you.
Regards,
Jagan.
