Choose Language Hide Translation Bar
Highlighted
nihal96
Level I

Sort and Group Data Set

I have a list of variables. I want to group certain variables under certain groups.

For example, I have a list of variables: a, a, b, b, b, b, c, d, d, e, e, e

I want to sort the variables:

  • a, b and c as "control".
  • d and as "low spec"

 

I thought I could use the if and or functions from the formula editor as shown below but it doesn't seem to work

 

If( :Column 74 == ("a" | "b"),
	"control",
	"low spec"
)
1 REPLY 1
Highlighted
txnelson
Super User

Re: Sort and Group Data Set

The correct syntax for what you are attempting to do is:

If( :Column 74 ==  "a" | :Column 74 == "b",
	"control",
	"low spec"
)
If( contains({"a","b"},:Column 74)
	"control",
	"low spec"
)

Or you could use the Contains() function

Jim