14 Replies Latest reply: Feb 15, 2018 12:57 AM by Adwitiya Borah RSS

    Extract fields from GetFieldSelections

    Adwitiya Borah

      I have [Month] as a filter. I want to be able to select certain months at a random order and run a part of a code for those Months alone.

       

      if(GetSelectedCount([Change])=1 and GetSelectedCount(Month)=1 ,

              if(avg(TransitionMonthNum)>=num(Month),

                      Rangesum(above(total(sum({<Version={'1YP'}>}Value)),0,rowno(total)))

                    + sum(total {<TransitionMonth={'$(=getfieldselections(Month))'} , Version={'1YP'}>}Value)*[Change]/100,

                      Rangesum(above(total(sum({<Version={'1YP'}>}Value)),0,rowno(total)))

                      )

                    )


      The above code works when only one [Month] is selected. I want this to run when GetSelectedCount(Month)>1 and have the values from GetFieldSelections(Month) in an array or something, and then create a loop, so that the code works for all the months selected.

       

      What would be the best way to do this?