Comparar el contrato con lo facturado.
Los lookups traen el precio medio facturado y el último costo de cada artículo. Cumplimiento, variación de costos y margen son fórmulas calculadas sobre ellos, recalculadas cuando se actualiza el contrato.
| Columna | Fórmula |
|---|---|
| Precio facturado | lookup(source="datasets", name="Invoice lines", result="Net Price", match_by=['Item Number':'Item Number'], filter_by=['Customer' == 'header.Customer', 'Invoice Date' >= 'header.effectiveDate'], agg="avg") |
| Cumplimiento | if(abs('Invoiced Price' - 'Contract Price') > 0.01, "Off contract", "On contract") |
| Costo actual | lookup(source="datasets", name="Item costs", result="Unit Cost", match_by=['Item Number':'Item Number'], sort_by="-Effective Date", agg="first") |
| Desviación del costo | ('Current Cost' - 'Cost at Signing') / 'Cost at Signing' |
| Margen % | ('Contract Price' - 'Current Cost') / 'Contract Price' |