1 Reply Latest reply on Oct 27, 2019 6:05 PM by Nathan Mannheimer

    Use SCRIPT_REAL Occurred an Error

    Xulong Guo

      Hi Everybody,

           It is my first time to use Script_real in Tableau,so I have an problem need your help!

           I used Script_real to make a new field named "corrcoef",but when I put it into the label,there is an error occurred.Can u tell me why and help to solve it?


      Best regards,


        • 1. Re: Use SCRIPT_REAL Occurred an Error
          Nathan Mannheimer

          Hi Xulong,


          Thanks for reaching out! I believe the issue here is that you have no dimension on the view to break up the data. Tableau aggregates data passed to Python to the visual level of detail, and in this case, the sum of sales and the sum of profit create a single row of data, which causes an error in calculating a correlation. You need to add the dimension that you want to create rows in the data, ie Customer Name, to the visualization to create enough rows to calculate a correlation.


          You also want to make sure that your table calculation is addressing that dimension, not using it as a partition.