Hi Community,
Please help to resolve this issue. I am new to python, trying to add the 2 numbers which are passing from the two parameters as shown in below i.e First Number and Second Number.To split the numbers in parameter created split calculation in Tableau Level.I wrote the python logic to add the numbers which are passing from the First number and second number parameter.
When I execute the above logic. Python throwing an error "Cannot interpret json value of type 'array' as scalar value"
The same logic have executed at python IDE. I didn't face any issue. The logic shown in below
import numpy as np
i=0
First=np.array([[1,2,3]])
n=len(First)
Second=np.array([[4,5,6]])
third_arr=np.array([])
while i<=n:
third_arr=First+Second
break
print(third_arr.tolist())
Kindly help me where I am doing wrong in Tableau Calculation.
Thanks,
Rahul Puri
It looks like your code is receiving the values from Tableau as they are passed, ie as a list.
Try using an index, ie _arg1[0], for each argument to pull a scalar value out of those lists.
Sincerely,
Nathan
Become a Viz Whiz on the Forums!
Support the Community and master Tableau.