1 2 Previous Next 22 Replies Latest reply on Nov 30, 2016 7:29 AM by Helena Borski

    3D charts by Bora Beran Tableau don't work

    Helena Borski

      Bora posted a nice picture with all files to be uploaded. I tested this and I was not able to execute SQL Statement.

       

      Do you have step by step instruction to create 3d charts? I have x,y,z then how should I create the rotated x or y.

        • 1. Re: 3D charts by Bora Beran Tableau don't work
          Bora Beran

          Hi Helena,

          I just opened the workbook with no issues. What version of Tableau are you using?

           

          Thanks,

           

          Bora

          • 2. Re: 3D charts by Bora Beran Tableau don't work
            Helena Borski

            Do I receive the response to my problem? I would appreciate it

            • 3. Re: 3D charts by Bora Beran Tableau don't work
              Bora Beran

              Would you be able to provide your workbook? I can't tell what the issue is without looking at it since it works without any issues on Tableau Public and on my computer.

              • 4. Re: 3D charts by Bora Beran Tableau don't work
                Helena Borski

                I am looking for the following items:

                1) How did you create the x-rotated or y-rotated?2) Where did you enter your SQL statement?3) Do I need to create the parameter or the calculation field to 3d chart?

                 

                I prefer to find the problem on my own to learn. Could you give me a principle about the x-rotated or xz-rotated in Tableau?

                Thank you in advance

                • 5. Re: 3D charts by Bora Beran Tableau don't work
                  Bora Beran

                  Except the 3D with Axis sheet you don't need to write any custom SQL. Custom SQL is used to add the axis and grid on top of an existing table of data.

                   

                  x-rotated, y-rotated are calculated fields. Those are calculated fields, you can right click > Edit to take a look at their definitions. They are doing the transformations listed here  Rotation matrix - Wikipedia

                   

                  Parameters are for choosing the rotation angle. You can hard code them if you don't want to give consumers of the dashboard a way to interact with it and rotate as they wish.

                   

                  ~ Bora

                  • 6. Re: 3D charts by Bora Beran Tableau don't work
                    Helena Borski

                    Could you give me an example of x-rotated calculation instead of giving me the definition from Wikipedia? :-)Could you give me an example of parameters for choosing the rotation angel?Could you give me some tips how can I incorporate your custom SQL to any other data set? What areas do I need to change?

                    Thank you in advance!

                    • 7. Re: 3D charts by Bora Beran Tableau don't work
                      Bora Beran

                      Hi Helena,

                      To get x rotated you need two calculations.

                       

                      First step is this calculation:

                      Calculation1 that takes original x-y coordinates from the table and multiplies by sin and cos of the chosen rotation angle via parameter

                      [x]*COS([XY - Angle (Radians)])-[y]*SIN([XY - Angle (Radians)])

                       

                      Second one takes this calculation and does another similar transformation

                      [Calculation1]*COS([XZ - Angle (Radians)])-[z]*SIN([XZ - Angle (Radians)])

                       

                      The math is the matrix algebra shown in the article I shared earlier written as calculated fields.

                       

                      If you have a table with the same exact structure, inside the same workbook, you can go to edit connection, drag that table in then copy-paste the custom SQL as is. If your table has the same structure but has a different name just replace the name references. E.g. if instead of 3d.csv it was called ad.csv you need to do a replace all in a text editor to swap ad#csv for all occurrences of 3d#csv and resulting custom SQL would look like this.

                       

                      The first portion of select is all columns from the table. It just adds another column to indicate these are the points.

                       

                      The other ones draw the background frame hence have different types like Surface, Axis, Grid etc.  XTop, XBottom etc. parameters are used to set the size of the background so if you want the box drawn around the points larger or smaller you can tweak those values in Tableau. Multipliers like 0.33 and 0.66 are to create equal size grid cells.

                       

                      SELECT [ad#csv].[id] AS [id], 'Points' as [Type],

                        [ad#csv].[x] AS [x],

                        [ad#csv].[y] AS [y],

                        [ad#csv].[z] AS [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Surface1' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YTop> as [y],

                      <Parameters.ZBottom> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Surface1' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZBottom> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '3' as [id], 'Surface1' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '4' as [id], 'Surface1' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YTop> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '5' as [id], 'Surface1' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YTop> as [y],

                      <Parameters.ZBottom> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Surface2' as [Type],

                      <Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZBottom> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Surface2' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZBottom> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '3' as [id], 'Surface2' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '4' as [id], 'Surface2' as [Type],

                      <Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '5' as [id], 'Surface2' as [Type],

                      <Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZBottom> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Surface3' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Surface3' as [Type],

                      <Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '3' as [id], 'Surface3' as [Type],

                      <Parameters.XBottom> as [x],

                      <Parameters.YTop> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '4' as [id], 'Surface3' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YTop> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '5' as [id], 'Surface3' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Axis2_Grid1' as [Type],

                      0.33*<Parameters.XTop> + 0.66*<Parameters.XBottom> as [x],

                      <Parameters.YTop> as [y],

                      <Parameters.ZTop> as [z], 0.33*<Parameters.XTop> + 0.66*<Parameters.XBottom> as [Label]

                      FROM [ad#csv]

                       

                       

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Axis2_Grid1' as [Type],

                      0.33*<Parameters.XTop> + 0.66*<Parameters.XBottom>  as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                       

                       

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Axis2_Grid2' as [Type],

                      0.66*<Parameters.XTop> + 0.33*<Parameters.XBottom> as [x],

                      <Parameters.YTop> as [y],

                      <Parameters.ZTop> as [z], 0.66*<Parameters.XTop> + 0.33*<Parameters.XBottom>  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Axis2_Grid2' as [Type],

                      0.66*<Parameters.XTop> + 0.33*<Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Axis1_Grid1' as [Type],

                      <Parameters.XBottom> as [x],

                      0.66*<Parameters.YTop> + 0.33*<Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], 0.66*<Parameters.YTop> + 0.33*<Parameters.YBottom>  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Axis1_Grid1' as [Type],

                      <Parameters.XTop> as [x],

                      0.66*<Parameters.YTop> + 0.33*<Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                       

                       

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Axis1_Grid2' as [Type],

                      <Parameters.XBottom> as [x],

                      0.33*<Parameters.YTop> + 0.66*<Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], 0.33*<Parameters.YTop> + 0.66*<Parameters.YBottom>  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Axis1_Grid2' as [Type],

                      <Parameters.XTop> as [x],

                      0.33*<Parameters.YTop> + 0.66*<Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Axis3_Grid1' as [Type],

                      <Parameters.XTop> as [x],

                      0.66*<Parameters.YTop> + 0.33*<Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Axis3_Grid1' as [Type],

                      <Parameters.XTop> as [x],

                      0.66*<Parameters.YTop> + 0.33*<Parameters.YBottom> as [y],

                      <Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Axis3_Grid2' as [Type],

                      <Parameters.XTop> as [x],

                      0.33*<Parameters.YTop> + 0.66*<Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Axis3_Grid2' as [Type],

                      <Parameters.XTop> as [x],

                      0.33*<Parameters.YTop> + 0.66*<Parameters.YBottom> as [y],

                      <Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                      SELECT '1' as [id], 'Axis4_Grid1' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YTop> as [y],

                      0.66*<Parameters.ZTop> + 0.33*<Parameters.ZBottom> as [z], 0.66*<Parameters.ZTop> + 0.33*<Parameters.ZBottom>  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                      SELECT '2' as [id], 'Axis4_Grid1' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      0.66*<Parameters.ZTop> + 0.33*<Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                      SELECT '1' as [id], 'Axis4_Grid2' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YTop> as [y],

                      0.33*<Parameters.ZTop> + 0.66*<Parameters.ZBottom> as [z], 0.33*<Parameters.ZTop> + 0.66*<Parameters.ZBottom>  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                      SELECT '2' as [id], 'Axis4_Grid2' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      0.33*<Parameters.ZTop> + 0.66*<Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Axis5_Grid1' as [Type],

                      0.33*<Parameters.XTop> + 0.66*<Parameters.XBottom>  as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Axis5_Grid1' as [Type],

                      0.33*<Parameters.XTop> + 0.66*<Parameters.XBottom>  as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZBottom> as [z], '' as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '1' as [id], 'Axis5_Grid2' as [Type],

                      0.66*<Parameters.XTop> + 0.33*<Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZTop> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                       

                       

                      SELECT '2' as [id], 'Axis5_Grid2' as [Type],

                      0.66*<Parameters.XTop> + 0.33*<Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      <Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                      SELECT '1' as [id], 'Axis6_Grid1' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      0.66*<Parameters.ZTop> + 0.33*<Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                      SELECT '2' as [id], 'Axis6_Grid1' as [Type],

                      <Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      0.66*<Parameters.ZTop> + 0.33*<Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                      SELECT '1' as [id], 'Axis6_Grid2' as [Type],

                      <Parameters.XTop> as [x],

                      <Parameters.YBottom> as [y],

                      0.33*<Parameters.ZTop> + 0.66*<Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                       

                       

                      UNION ALL

                      SELECT '2' as [id], 'Axis6_Grid2' as [Type],

                      <Parameters.XBottom> as [x],

                      <Parameters.YBottom> as [y],

                      0.33*<Parameters.ZTop> + 0.66*<Parameters.ZBottom> as [z], ''  as [Label]

                      FROM [ad#csv]

                      • 8. Re: 3D charts by Bora Beran Tableau don't work
                        Helena Borski

                        Thank you for your feedback.

                        I was trying to set up the rotated calculation 1 but all look good until the end of the calculation says: Expected closing parenthesis or comma while parsing argument list for COS

                        COS([XY - Angle (Radians))-[y]SIN() Your original was: COS()-[y]SIN() I need to remove ] after Radians because Tableau underlying the entire calculation with your original example. I marked the removed part on the red color

                         

                         

                        What can I do that? I don't have a problem with a matrix math but the problem is how I can the matrix math incorporates to my calculation in Tableau

                        • 9. Re: 3D charts by Bora Beran Tableau don't work
                          Bora Beran

                          You have some typos. For example [XY - Angle (Radians)] is a field name and needs to be written between square brackets but in your calculation, square bracket is missing.

                           

                          COS([XY - Angle (Radians))-[y]SIN()

                           

                          Corrected version

                          COS([XY - Angle (Radians)])-[y]*SIN([XY - Angle (Radians)])

                           

                          If you don't mind me asking, why did you prefer, typing in new formulas, instead of reusing existing ones using copy-paste etc.?

                           

                          I know quite a few other Tableau users, that use the formula as is.

                           

                          Thanks,

                           

                          Bora

                          • 10. Re: 3D charts by Bora Beran Tableau don't work
                            Helena Borski

                            I am using a different variables in place of X and Y

                             

                            When I want to reuse your full x rotated then the system says X is not defined

                             

                            Sent from my iPhone

                            • 11. Re: 3D charts by Bora Beran Tableau don't work
                              Helena Borski

                              If I copy this then it doesn't work because is undefined field 

                               

                              Any Thoughts?

                              • 12. Re: 3D charts by Bora Beran Tableau don't work
                                Bora Beran

                                You can copy-paste then replace the name of the fields without removing the square brackets or rename your fields and then copy-paste the calculated fields. It should work either way.

                                • 13. Re: 3D charts by Bora Beran Tableau don't work
                                  Helena Borski

                                  I did but the system doesn't like the closing statement "]"

                                   

                                  Sent from my iPhone

                                  • 14. Re: 3D charts by Bora Beran Tableau don't work
                                    Helena Borski

                                    Could you double check your z rotated again?

                                    I am sure is some error because I copy and past to Tableau and it doesn't work

                                     

                                    Sent from my iPhone

                                    1 2 Previous Next