Skip to main content

Hi Pigmenteers! 

When reading Top Tips for modeling in Pigment - Part 2: Performance Optimisation, there’s an idea as highlighted in the screenshot below: to avoid doing too much within one metric, there’s “a good guideline is that, if you have to copy and paste part of a formula more than once, it may be worth its own metric” - I don’t quite get it, can you help explain this idea to me? 

 

Hi Thu Mai,

 

copy paste here means that the same “formula” exists in two metrics as part of a larger one.

We advise for that in order to avoid Pigment recalculating the same thing in several metrics & being able to parallelize calculations.

 

example of too much recalculations:

Salary = Annual Salary /12 * prorata(month,Employee.Start, Employee.End)

Tax = Annaul Salary / 12 * TaxRateaby:Employee.Country] * prorata(month,Employee.Start, Employee.End)

 

You should rather do that:

FTE =  prorata(month,Employee.Start, Employee.End)

Salary = Annual Salary /12 * FTE

Tax = Salary *TaxRate*by:Employee.Country]


@Nathan oh I got it, your example is very clear, thank you so much!!


Reply