Solved

BY LASTNONBLANK

  • 4 August 2022
  • 2 replies
  • 30 views

Userlevel 3
Badge +1

Hi,

 

I am trying to use BY LASTNONBLANK function to capture the last non blank value in “A” metric (with dimension Month), and get this value in “B” metric (no dimensions there), so that in B metric I will have only the value from most recent Month.

I used the following formula in metric B:

“Metric A” [BY LASTNONBLANK: Month]

The result I am receiving is the sum of all months (the same result I would receive if left “Metric A” in formula without any modifiers).

Do you know how I can retrieve the last nonblank value from the Metric?

icon

Best answer by francois 5 August 2022, 09:40

View original

2 replies

Userlevel 4
Badge +3

Hi Dastan,

I think the best modifier is REMOVE as in “Metric A” [REMOVE LASTNONBLANK: Month] .

BY is suited when you’re trying to replace a dimension with another, REMOVE is when you’re removing a dimension from the structure of the block.

Your use of LASTNONBLANK is good though!

François

Userlevel 3
Badge +1

Hi Francois,

 

Thank you, that worked. I’ve been trying to apply REMOVE, but did it separately. Didn’t think of combining them. Guess learned another new useful thing!

Reply