Re-use a previously used calculation in the script
Often I find my self in need of a previously written calculation later in the same script. How can I reuse the calculation?
This is what I would like to be able to do, even though I know this is not possible I think this explains it best:
if(Ordertype=1 and MyMeasure<=1,'A',
if(Ordertype=1 and MyMeasure>1 and MyMeasure<=5,'B',
if(Ordertype>1 and MyMeasure>1 and MyMeasure<=26,'C',
So my question is, can I do something like this? Or do I have to make resident loads to acomplish this without having to copy/paste the calculation of MyMeasure into the calculation in [MyMeasure groups] 8 times!
Observe that this example is not realistic, its just an example.
Perhaps using a variable for MyMeasure is the solution?