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

Hi, 

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.
 

image.png.02263f0e29e20b39810bc826128d0fdf.png

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:

image.png.995594ebe3e2723319438053ea30fd36.png

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

image.png.dc9a889894c94ff35cf1d7c07642e986.png

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.

image.png.1130ba3b05b95ac47881b69ecc403a81.png

Regards,

Thorsten

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...