Jump to content

"Case when" type syntax in Formulas

Go to solution Solved by Thorsten Vogt,

Recommended Posts

I have a series of lots imported as conditions from a csv file.
I am calculating a transition analysis, which requires the manual input of the packed bed height. 
I want to write some kind of formula that says "when lot number = 12345, then bed height=22. When lot number =45678 then bed height=25, etc". Any suggestions?

Link to comment
Share on other sites

  • Solution


you can do this by using splice(). The following example takes 10 as the default value and changes the part of the signal to 15 or 22 based on the value of the batch id.


If the lot number you mentioned is a property of the capsule you imported you might need to convert it to a signal using toSignal() and the property name that is used to store the lot number:


Or filter for capsules that contain the lot number using keep() on the condition:


You can check your capsules for existing properties by having a look at the Capsules Pane. When clicking the "Add Column" icon you are able to choose the properties from the dropdownlist of available properties. The name of the property can be used in the functions mentioned above.




Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...