Using Labels

The Problem

With solid models that array abstract, we know that we can change a variable upstream and have coherent results downstream. One thing that disturbs this robustness is textual entries. When we manually enter text throughout our model, not only do we open ourselves to issues such as a mismatch, but also that if that text needs to change, we have to manually go throughout the model and make those changes.

The Solution

By using 'labels', you can change indices upstream without fear of breaking something downstream.

For example, normally if I wanted to slice out data it'd be done like so:

Label Image 1.png

Instead, I can create a 'label' node that points to the header in my index:

Label Image 2.png

If I then change my slice operation (shown below), I'm free to edit my index without having to ever worry about previous slice operations again!

Label Image 3.png

You can download the example model shown above here: Label_Model.ana.



18 months ago
Score 0
This might be some of the best advice on this wiki for anyone who builds models used by different clients or who builds models that are constantly evolving! After working many years on a very large model developed in parallel with 7 different organizations, I had to learn the pitfalls of not using label variables the hard way (eg, tediously searching down all references to updated index entries). Now I use label variables religiously in all my models, and they make updating models (eg, for new clients or for internal purposes) significantly faster and easier.

You are not allowed to post comments.