9 Replies Latest reply on May 4, 2014 9:13 PM by Joshua Milligan

    Help please with IF THEN ELSE statement? Weird behaviour

    david sacks

      Hi All,

       

      First, forgive me if this is the wrong area to put this -- I couldn't figure out a better place  :-)

       

      Anyhow, here is my IF THEN ELSE

       

      'Program                ' +

      if   [Parameters].[DEMOs 1] = 0

      then '  HH  '

      elseif   [Parameters].[DEMOs 1] = 1

      then  'P1834'

      elseif   [Parameters].[DEMOs 1] = 2

      then  'P1849'

      elseif   [Parameters].[DEMOs 1] = 3

      then  'P2554'

      elseif   [Parameters].[DEMOs 1] = 4

      then  'M1834'

      elseif   [Parameters].[DEMOs 1] = 5

      then  'M1849'

      elseif   [Parameters].[DEMOs 1] = 6

      then  'M2554'

      elseif   [Parameters].[DEMOs 1] = 7

      then  'F1834'

      elseif   [Parameters].[DEMOs 1] = 8

      then  'F1849'

      elseif   [Parameters].[DEMOs 1] = 9

      then  'F2554'

      elseif   [Parameters].[DEMOs 1] = 10

      then  'P1224'

      elseif   [Parameters].[DEMOs 1] = 11

      then  'P3549'

      elseif   [Parameters].[DEMOs 1] = 12

      then  'P50+'

      elseif   [Parameters].[DEMOs 1] = 13

      then  'M1224'

      elseif   [Parameters].[DEMOs 1] = 14

      then  'M3549'

      elseif   [Parameters].[DEMOs 1] = 15

      then  'M50+'

      elseif   [Parameters].[DEMOs 1] = 16

      then  'F1224'

      elseif   [Parameters].[DEMOs 1] = 17

      then  'F3549'

      elseif   [Parameters].[DEMOs 1] = 18

      then  'F50+'

      elseif   [Parameters].[DEMOs 1] = 19

      then  'P1217'

      elseif   [Parameters].[DEMOs 1] = 20

      then  'P18+'

      elseif   [Parameters].[DEMOs 1] = 21

      then  'M1217'

      elseif   [Parameters].[DEMOs 1] = 22

      then  'M18+'

      elseif   [Parameters].[DEMOs 1] = 23

      then  'F1217'

      elseif   [Parameters].[DEMOs 1] = 24

      then  'F18+'

      end

       

       

      When I try to Apply this I get the following:

       

      Tableau Data Engine Error 4; PrimitiveExp::MakePrimitive:

      map_concat_usr1_val_usr2_val

       

      If I comment out:

          elseif   [Parameters].[DEMOs 1] = 9

          then  'F2554'

      The process can be applied

       

      If I change the then value::

          elseif   [Parameters].[DEMOs 1] = 9

          then  'M2554'

      The process can be applied

       

      BTW, this is a dimension that I am currently editing....

       

      Thanks all,

       

      David