Can I model complex variables?

What I’m trying to do is define a “type” or “template” (or “class” for us software engineer types) for “stock received” in a personal financial forecast that includes stocks received via RSU grants and via ESPP purchases. When I enter stock received I want to enter quantity, grant/offering date, discount % (0 for RSU, but non-zero for ESPP and important for tax calculations), and Cost Basis (inferred from current stock price for RSU, fixed for ESPP)
I keep being tempted to try and (mis?)use “categories” for this and then getting bitten because everything in a “category” is expected to be a value of the same type.
I know I can just define each as an independent variable and then group them, but that means doubling num of variables just to support these two mildly different flavors of things, which feels wrong. Is there another approach similar to categories but that would allow me to define a schema for collections of values that have disparate types?

Hey @RookieRick :wave:

You can use category items in if statements to dynamically define a variable’s categorical values.

The two screenshots below show two different ways of doing this, the second method using a list (i.e. if Department is in Sales or Marketing).

That way the variable (e.g. Discount) still has one formula, it is just defined differently for each category item. Does that make sense?


1 Like

I think this may work - will try poking at this next time I update my model (I did manage to get it working as I intended it to with my hacky approach, but this definitely feels like it has potential to be much cleaner if I can retrofit it without having to rebuild too much stuff :smile: )