To register for the forums, please contact your Digital-Clay representative.

SUM Function

Community-oriented help and tech-support for the Digital-Clay platform.
Post Reply
yonadav
Posts: 17
Joined: Fri Apr 03, 2009 2:29 pm

SUM Function

Post by yonadav »

Hi,

I Like this function very mech, but I want it to add only the fields on the active linked items to calculation, and to ignore the inactive items.

How do I do that? Sumbody, please help!
ZevToledano
Posts: 722
Joined: Fri Apr 03, 2009 2:29 pm

Re: SUM Function

Post by ZevToledano »

If you mean the Sum function in Custom Functions, then this is impossible because it necessitates a filter.

If you need a Sum function with a filter then your only choice is to use the normal Analysis Sum function and add a filter there. I.e. Either add an analysis table/value to your report/dashboard/tab, or use automation to store this value inside a field using a Set Field Query action.
yonadav
Posts: 17
Joined: Fri Apr 03, 2009 2:29 pm

Re: SUM Function

Post by yonadav »

Can't I use in the sum function a nested if that will return 0 for inactive items and for the active items it will return the real value of the aggregated field?
ZevToledano
Posts: 722
Joined: Fri Apr 03, 2009 2:29 pm

Re: SUM Function

Post by ZevToledano »

That's a very good idea! I checked the code to see if this would be possible and found that it was missing one code tweak in order to allow this. I made the change and it will be released in the next version...
yonadav
Posts: 17
Joined: Fri Apr 03, 2009 2:29 pm

Re: SUM Function

Post by yonadav »

Thank you Zev! you are the best!

I hope you don't forget to let this trick for Count , Avg and Max as well.
ZevToledano
Posts: 722
Joined: Fri Apr 03, 2009 2:29 pm

Re: SUM Function

Post by ZevToledano »

Well you can't do this with Count obviously because Count doesn't allow an inner function (you only select a table). But if you build a Sum(if(a=b,1,0)) then it's the same as a Count.
Post Reply