2 Replies Latest reply: Jan 20, 2017 10:51 AM by Zhihong He RSS

    Count general values and selected values



      I need to develop a routine which will count general values of a such interval of time, if no month is selected, and if one month is selected, must count all the values of the selected month.


      At this time, I have the routine below:



          Count({$<dataMonth={$(#=Num((Month(AddMonths(Today(), -1)))))}, [SomeField]={"Q"}>}[SomeField]),

          Count({1<dataMonth={$(#=dataMonth1)}, [SomeField]={"Q"}>}[SomeField])




      Additionally, I will need to match values of the past year, if the selected month is january or february. How can I match that?

      I've tried something like:



      IF(GetFieldSelections(name_month)='jan' OR GetFieldSelections(name_month)='fev',

              Count({$<dataMonth={$(#=Num(Month(Today())))}, dataYear={$(#dataYear-1)}, [SomeField]={"Q"}>}[SomeField]),

              Count({1<dataMonth={$(#=dataMonth)}, dataYear={$(#dataYear-1)}, [SomeField]={"Q"}>}[SomeField])





      Can anyone help me in this?