Skip to main content
Solved

Pulling the last available value with BY ->

  • March 25, 2025
  • 1 reply
  • 67 views

Forum|alt.badge.img

I have the formula below: 

(('EE_Comp_01_SabbaticalAccrual_P&L_ReAllocated'
    * EE_BU_AllocationFinal
    )[BY: -> EE_Card_Department,EE_Card_SalaryCurrency, 'EE_Card_P&L', 'EE_Card_Direct/Indirect'])

The highlighted in red, assigned my employees to the department that they belong for each month based on that metric. INSTEAD, I would like to just assign them to the last department they belonged to for each version.  I tried inserting “BY LASTNONBLANK: → “  but it did not seem to resolve the issue. See screenshot for the stracture of the EE_Card_Department below: 

 

Basically I want to adjust the formula above, to assign this employee only to department FBS Revenue. 

 

Any ideas? 

Best answer by Nathan

Hi,

It’s better to do that in two steps.

Let’s say your metric is called MDEPT. 

Do this:

MDEPT[remove lastnonblank: Month]

 

If you want to have that last value on EVERY Month do:

MDEPT[remove lastnonblank: Month][By:Month]

1 reply

Nathan
Employee
Forum|alt.badge.img+12
  • Employee
  • 227 replies
  • Answer
  • March 25, 2025

Hi,

It’s better to do that in two steps.

Let’s say your metric is called MDEPT. 

Do this:

MDEPT[remove lastnonblank: Month]

 

If you want to have that last value on EVERY Month do:

MDEPT[remove lastnonblank: Month][By:Month]