function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
petec@i2isyspetec@i2isys 

Formula to group stages

Hi,
I would like to figure out how to create a formula field that would evaluate stages and set a "phase" based on the stage.
Alternatively, I'd be OK with the Phase being a picklist, but updated from a workflow rule.

So if stages are Planning, Kick-off, Discovery, Software, Data, Training, & Closing, I would want the "phase" field to be set appropriately.

So if stage is in Planning OR Kick-off, then Phase is "Project Planning";
if stage is Discovery OR Software OR Data, then Phase is "Tech"; 
if Stage is Training OR Closing, then Phase is "Closing".

Does anyone have any suggestions?
Thanks!
badibadi
Try this,
Create Forumla field of type text, assuming Stage is of type Picklist,

CASE( TEXT( stage) ) , 
"Planning", "Project Planning", 
"Kick-off", "Project Planning", 
"Discovery", "Tech", 
"Software", "Tech", 
"Data", "Tech", 
"Training", "Closing", 
"Closing", "Closing", 
"" )

Hope this helps
petec@i2isyspetec@i2isys
I'm getting an extra ',' error right after the first comma in the first line.
 
Akhil AnilAkhil Anil
Hi Pete,

Simply use the below formula
 
CASE(StageName,
"Planning","Project Planning",
"Kick-off","Project Planning", 
"Discovery","Tech", 
"Software","Tech", 
"Data","Tech", 
"Training","Closing", 
"Closing","Closing", 
NULL)

Use the insert field option to use the right API name of the fields.

kindly mark it as an answer if that works !
badibadi
Sorry, I did not realise i put extra bracket . Here is the fix
 
CASE( TEXT( stage) , 
"Planning", "Project Planning", 
"Kick-off", "Project Planning", 
"Discovery", "Tech", 
"Software", "Tech", 
"Data", "Tech", 
"Training", "Closing", 
"Closing", "Closing", 
"" )

 
petec@i2isyspetec@i2isys
Hi Badi and Akhil, for both ways I get this error:
Error: Formula result is data type (Text), incompatible with expected data type (true or false).
 
Sure@DreamSure@Dream
Hi Pete,

You might have selected the "Formula Return Type" as "Checkbox", select "Text" instead.
It will be the second step, while creating a formula field.

Thanks
petec@i2isyspetec@i2isys
I'm trying to run this in a workflow that evaluates the stage and then does a field update on the phase. So if it worked it would update the phase picklist with a value.