I think Tableau can do the calc as long as the complexity of the formula is below level.
sqrt(average of the real parts ^2 + average of imaginary parts^2).
But that really depends on your data structure.
If you attach packaged workbook, community members will easily help for more detailed solution.
Ideally I'd like to know if Tableau can handle a complex number datatype natively i.e. (X+Yi) as a single entity rather than as two individual numbers for the real and imaginary parts.
I'm less convinced than Shin regarding this calculation:
sqrt(average of the real parts ^2 + average of imaginary parts^2)
This is because if your average of imaginary parts > average of real parts, you'll be trying to compute the square root of a negative number (i squared is -1) and get an error.
I think you can avoid this situation by using a simple IF clause first:
Create a calc adding the two
REAL PLUS IMAGINARY SQUARED
(average of the real parts ^2 + average of imaginary parts^2)
Now use an IF statement in a second calc:
IF [REAL PLUS IMAGINARY SQUARED] >= 0 then STR((SQRT([REAL PLUS IMAGINARY SQUARED]))
ELSEIF STR((SQRT(-[REAL PLUS IMAGINARY SQUARED]))+"i"
Here I'm adding "i" to any imaginary result... I'm also converting them as STRINGS.
If you know your imaginary values will always be less than your real values, you;ll be OKAY.
It is only the component of imaginary part that is squared and summed, not the "i" itself. For example the average of 2+5i & 4+3i is (2+4)/2 + (5+3)/2i = 3+4i and its magnitude would be sqrt(3^2+4^2) = 5
If you type the following in to Excel you will see an example of a complex number data type that can be operated on as an entity - "=complex(3,4)", although even Excel doesn't manage to conduct calculations on complex numbers.
Thank you-- I was mistaken
...and I learned something I never knew about Excel!