Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

groups and binning

Hello, 

 

I have list of month year in a table. (Jan 2018, Feb 2018, Mar 2018, Apr 2018, May 2018, June 2018, Jul 2018, Aug 2018, Sept 2018, Oct 2018, etc), I want to group it every 2 months, so, Feb 2018 - actually consist of Jan and Feb 2018, Mar 2018 is actually consist Feb 2018 and Mar 2018. How can I achieve this? I tried grouping, but the group only allows to add in the list once. Please advice if you have other ways to do this! Thank you!

 

Thanks & Rgds,

Lina

10 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    For the groupping you can do something like

     

    YourCalculatedColumn = 
    Roundup(Month(<your date>)/2,0)

    If you do not have a date, then you could just use SWITCH

    YourCalculatedColumn =
    SWITCH(
      TRUE(),
      LEFT(< month column >, 2) = "Jan", "Feb 2018",
      LEFT(< month column >, 2) = "Feb", "Feb 2018",
      ...
    )
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, 

       

      I don't have a date, it's just showing month and year. By using the second solution, it means I need to add in all possible combinations. What if I have all months from 2015 - up to anytime in the future? Is there any way to do this dynamically?

       

      Thanks & Rgds, 

      Lina

      • Anonymous's avatar
        Anonymous
        Not applicable

        Then you could do:

        YourCalculatedColumn =
        SWITCH(
          TRUE(),
          LEFT(< month column >, 2) = "Jan", "Feb " & RIGHT(< month column >, 4) ,
          LEFT(< month column >, 2) = "Feb", "Feb " & RIGHT(< month column >, 4),
          ...
        )

        If this solves the problem, please like it and mark it as solution.

         

        Best regards,

        Kristjan76