Welcome Guest! To enable all features please Login or Register.
Go to last post Go to first unread
#1 Posted : Friday, October 7, 2016 9:42:21 AM(UTC)
Rank: Advanced Member

Groups: extranet\Webinar
Joined: 5/6/2016(UTC)
Posts: 14

I have another question regarding analysis in Targit.
How can I handle "undefined" value in calculation fields?

I have a simple table with the Site ID and number of records per site.
Let's assume that we have 3 different sites but only two of them have records related:


Calculated fields:
- Total Visible: allcount(0, all(v), 0, 0)
- Total Count: allcount(0, all, 0, 0)
- %: allcount(0, all(v), 0, 0) / allcount(0, all, 0, 0)

When I select the site which has rows I get the proper result.


But when I select Pickering (which has no rows) I will get 'Undefined' value.


Is there any way to handle this exception(I want to get 0 instead of 'Undefined')?
Maybe something like isnull() function in TSQL? Or maybe there is a way to handle this with If There Else statement?
Somewhere on the forum I found information that the 4th parameter in e.g. allcount(0, all, 0, 0) should solve the problem, but unfortunately it doesn't.

Anmol Sunsoa  
#2 Posted : Monday, October 17, 2016 6:49:19 PM(UTC)
Anmol Sunsoa
Rank: Advanced Member

Groups: extranet\Webinar
Joined: 5/5/2016(UTC)
Posts: 13

Hello Karol,

I have experienced this and the best way is to check both values in the calculation like
if sum(d-1,0,m1)=0 Then 0 else sum(d-1,0,m1)/sum(d-2,0,m1).

Kind Regards

Anmol Sunsoa
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.



We use cookies to improve your site experience, but they also provide us with information on your use of our website.
To find out more about the cookies we use and how to delete them, see our Privacy Policy. By continuing to browse the site, you are consenting to our use of cookies.