Factors vs Functions

What are the differences

Marco Salerno
Written by Marco SalernoLast update 1 year ago

Portfolio123 uses different ways to access data points. The two primary ways are factors and functions. The difference between them is that functions take parameters, while factors do not.


For example, the most recent trailing-12-month sales figure can be accessed using this factor:


SalesTTM


You can use it directly in a rule (SalesPTM is the prior 12-months figure.):


SalesTTM>SalesPTM


The most recent trailing-12-month sales can also be accessed with a function:

Sales(0,TTM)


The zero means the most recent figure, and the TTM means trailing-12-month. That function, with those parameters, will always be equal to the factor form:


SalesTTM=Sales(0,TTM)


Why do we do this? Sometimes it's easier to use a factor. Learn it once, use it forever. It's also easier to double-click to highlight it and copy/paste it in other parts.


Sometimes it's necessary to use a function: there is no factor for the sales as it stood 16 quarters ago, for example. (And honestly, learning the functions isn't much more work than learning the factors.)


Did this answer your question?