Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago
Solved

Group by in a new column

Hi everyone!   I want to add a new column with the family of the items in a table. There is any formula in which you give a list of values and if the value is matched then you make an action. Som...
  • Anonymous's avatar
    Anonymous
    10 years ago

    Hi Mozasf,

    You could use if function or switch function to create a calculate column to achieve your requirement.

    Sample:

    1. IF function.

    Family = if([ID_item]=1|| [ID_item]=2||[ID_item]=4,"Family_1",if(OR([ID_item]=3,[ID_item]=5 ),"Family_2","Family_3"))

     

    2. Switch function.

    Family = SWITCH([ID_item],1,"Family_1",2,"Family_1",4,"Family_1",3,"Family_2",5,"Family_2","Family_3")

     

    Regards,

    Xiaoxin Sheng