4 Replies Latest reply on Oct 21, 2018 9:52 AM by Milankumar Patel

    Convert SPSS Syntax to Tableau Calculation

    Milankumar Patel

      Hi,

      I want to convert below SPSS Syntax to Tableau Calculated field so I can use in my chart creation view.

       

      Basically, what it does, VAR_1 has 3 options. Below syntax takes, First value of each variable in VAR_* series and creates a new variable named "VARMRV".

      ****************************************************************************************************************

      IF  (VAR_1 = 1) VARMRV=1.

      IF  (VAR_2 = 1) VARMRV=2.

      IF  (VAR_3 = 1) VARMRV=3.

      IF  (VAR_4 = 1) VARMRV=4.

      IF  (VAR_5 = 1) VARMRV=5.

      IF  (VAR_6 = 1) VARMRV=6.

      IF  (VAR_7 = 1) VARMRV=7.

      IF  (VAR_8 = 1) VARMRV=8.

      IF  (VAR_9 = 1) VARMRV=9.

      IF  (VAR_10 = 1) VARMRV=10.

      IF  (VAR_96 = 1) VARMRV=96.

      EXECUTE.

       

      * Define Variable Properties.

      *VARMRV.

      VARIABLE LABELS  VARMRV 'Top 1 Data from VAR Series'.

      VALUE LABELS VARMRV

        1.00 'Reason1'

        2.00 'Reason2'

        3.00 'Reason3'

        4.00 'Reason4'

        5.00 'Reason5'

        6.00 'Reason6'

        7.00 'Reason7'

        8.00 'Reason8'

        9.00 'Reason9'

        10.00 'Reason10'

        96.00 'Reason11 '.

      EXECUTE.

      *********************************************************************************************************

       

      I want to create same thing in Tableau. How can i do this?

       

      Thanks in advance.