Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Grouping

Hey

 

I have a column called Age. I want to seperate it as groups like

 

Age 55+

Age 45-55

Age 35-45

 

How can this be done?

  • Hi - Create a calculated column such as

    Age Group = SWITCH(True(), [Column Name] <=45, "35-45",
    [Column Name] <=55,"45-55","+55")

    This is assuming that there are no ages below 35 in have data.

    D

7 Replies

  • davehus's avatar
    davehus
    Memorable Member
    Hi - Create a calculated column such as

    Age Group = SWITCH(True(), [Column Name] <=45, "35-45",
    [Column Name] <=55,"45-55","+55")

    This is assuming that there are no ages below 35 in have data.

    D
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank You! Bur what comes under column name? The variable Age comes under a table called Students. So would the column name be Student[AGE]?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous

     

    The above solution by davehus will work for you.

     

    Just for your information - You can right click your age column and select "New Group" and then you can create grouping there. This is best suitable if you want to group some category, as in your case there is no gurantee that you will have all ages in your data.

     

    Thanks

    Raj

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank You. But I want the legend to be shown as '45-55', '35-45' etc. Doing Groups just shows Age(bins) as 30, 35 etc given the size of the bin chosen. IS there any other way

      • davehus's avatar
        davehus
        Memorable Member
        The Switch function I provided you with will work.