11 Replies Latest reply: Aug 13, 2018 8:06 AM by Richard Fels RSS

    Aggr Function with GetFieldSelection and Set Expression into Script Variable

    Richard Fels

      Hi all,

       

      I have an issue with the creation of a variable in the script part, however it seems to be problematic, hope somebody can have a quick look

       

      This is my data

       

        t1

      IdDimVal
      id1a5
      id1b7
      id1c19
      id2a8
      id2b10
      id2c15

       

      Another field called "DimSelect" used in the set analysis later and refered to by the GetFieldSelections expression is created by ->

      Nav:

      Load Distinct

           Dim as DimSelect

      Resident t1;

       

      Now, creating chart function works fine:

      =aggr(max( {<Dim={'$(=GetfFeldSelections(DimSelect))'}>} Val), Id)

       

      However, I would like to have this chart function as a variable created in the script, and unfortunately it does not work

       

      Script:

      let vAggr = 'aggr(max( { <Dim = {"$(=GetFieldSelections(DimSelect))" }> }  Val), Id)';

       

      Chart:

      =$(vAggr)

       

      Does anyone possibly know what I am doing wrong? The issue seems to be with the expression GetfieldSelections(DimSelect), because inserting a value like "b" instead of GetFieldSelections expression also works fine.

       

      Thanks!