11 Replies Latest reply: Jun 14, 2018 8:36 AM by Sunny Talwar RSS

    Set analysis with dynamic variable

    Wayne Antinore

      Hi, I've been trying to get a set analysis expression working with a variable without any luck.  My variable value is set dynamically depending on selection(s) of a dimension.  Definition is as follows:

       

      If(GetSelectedCount(Test_ID)<> 1,('SYP' &  ',' & 'RPR'),

            If(MixMatch(GetFieldSelections(Test_ID),'SYP'),('SYP'),

            If(MixMatch(GetFieldSelections(Test_ID),'RPR'),('RPR'),('SYP' &  ',' & 'RPR'))))

       

      When I put this value in a KPI it displays as SYP,RPR but if I use it in a set analysis expression like the following it doesn't apply and shows up as a - in the kpi

      =Count({$<Positive = {'Y'},Test_ID={$(=vSYPRPR)}>}[Order#])

       

      If I define the variable like the following then the correct values are returned

      ='SYP,RPR'

       

      Is it not possible to use a dynamically defined variable in set analysis?  I've looked up lots of examples of using variables in set analysis and tried the various examples I've seen on the community but have not been able to get this to work.

       

      Thanks in advance for any help or insight.