Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I need help with a calculation. I put an example:
I currently have this calculation created --> (Field 1 + Field 2 + Field 3 + Field 4)/4.
The problem is that sometimes some field is null. When this happens I want the division to change. For example:
(Field 1 + null + Field 3 + null)/2.
I want the calculation to only split the fields that are not null.
Thanks.
@Jqlik If I understood correctly ?
=RangeSum([Field 1],[Field 2],[Field 3],[Field 4])
/
RangeSum(if(len([Field 1])=0,0,1),if(len([Field 2])=0,0,1),if(len([Field 3])=0,0,1),if(len([Field 4])=0,0,1))
output:
@Jqlik as @marcus_sommer suggested use rangecount instead like below
RangeSum([Field 1],[Field 2],[Field 3],[Field 4])/
Rangecount([Field 1],[Field 2],[Field 3],[Field 4])
@Jqlik If I understood correctly ?
=RangeSum([Field 1],[Field 2],[Field 3],[Field 4])
/
RangeSum(if(len([Field 1])=0,0,1),if(len([Field 2])=0,0,1),if(len([Field 3])=0,0,1),if(len([Field 4])=0,0,1))
output:
Why not using rangecount() as divisor?
- Marcus
Thanks!
this solution is perfect.
@Jqlik as @marcus_sommer suggested use rangecount instead like below
RangeSum([Field 1],[Field 2],[Field 3],[Field 4])/
Rangecount([Field 1],[Field 2],[Field 3],[Field 4])