Store by reference or not, the calculation is the same:
Case ( classification code= 1 ; ContainerAField ;
classification code= 2 ; ContainerBField ;
Make sure that you select "container" as the return type for your calculation field.
You could also use the Choose function since the codes are 1, 2, 3...
Choose ( classification code ; "" ; ContainerAField ; ContainerBField ; ContainerCField )
"" is a place holder for when classification code = 0 as Choose works from index values starting with 0.
If the global containers where instead a single repeating global container with 3 repeatitions, the calc could be even simpler:
GlobalContainer [ classification code ]
I can go you one better. Put the images in a related table with one record per image.
Define this relationship:
OriginalTable::Classification Code = Images::Classification Code
Now you can put the container field from the Images table on your Original table layout and the selected image will appear with no calculation needed at all--just the relationship. (And you can add additional images simply by adding more records in the Images table.)
To PhilModJunk a tip of the hat! That was an elegant and simple solution I should have seen myself and it worked as advertised!