Here I have a part family part. First in the Attribute Templates I define an attribute title called "Type", "Integer" for Data Type, List "59, 60, 61". Then create expressions as follows
Type=linked to attribute "Type"
Length={40,60,80}
L=nth(Type,Length)
Then I found when Type<2, L=40...