5 Replies Latest reply on Oct 13, 2015 12:21 PM by david.cooke.0

    Can I use a calculated field to determine if a value is part of a set?

    Zac Hilbert

      I haven't seen anything addressing this on the forums, so maybe someone has some ideas.

       

      Let's say I have data like the following:

       

      (id,category,value)

      (1,a,40000)

      (2,a,42000)

      (3,b,45000)

      (4,c,23000)

      (5,d,50000)

       

      And I have a set based on either category or value (e.g. Set A = category is in {a,c}; or Set B = id has sum(value) >= 45000).

       

      Is there a way I can test for membership within a set in a calculated field.  For example, I am looking to do something like this

       

      AdjustedValue = if [category] is in [Set A] then [value] * [SetAMultiplier] else [value] end

       

      or

       

      SetBCategories = if [id] is in [Set B] then  [Category] else null

       

       

      I know I could just place the set defining logic within the calculated fields, but this doesn't help if I need to change the set members or criteria, especially if I had many calculated fields with to update whenever the set logic changed.

       

      Thanks,

       

      Zac