0 Replies Latest reply: Aug 3, 2017 10:23 AM by Michael Adolph RSS

    Evaluate function within a field name

    Michael Adolph

      Hi everybody,

       

      I have to get a value from an existing field in the table, based on a function.

       

      As an example:

       

      test:

      LOAD

      SomeValue

         ,[Value_$(floor(SomeValue/3) + 1)]  AS  DependentValue;

      LOAD

      IterNo()  AS    SomeValue

          ,'a'   AS  Value_1

          ,'b'   AS  Value_2

          ,'c'   AS   Value_3

      AUTOGENERATE 1

      while IterNo() < 9;

       

      the lower load Statement will create a table with 8 rows and 4 fields.. the upper Load Statement should now select one of these field values, depending on the first field.

       

      the expecte result would be

       

      test:

      SomeValue | DependentValue

      1 | a

      2 | a

      3 | b

      4 | b

      5 | b

      6 | c

      7 | c

      8 | c

       

      But I only get an Fielde "Value_" not found error, obviously the function is not evaluated correctly.

       

      Thanks for any help

       

      Michael