Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Formula using the value of previous year

Good afternoon,

I'm struggling with a code. Let me explain what I trying to do.

I got 5 measures and 1 column(Exercice Civil non limité),

I join you a photo of my measures:

All my measures is right exept the first one ("Port Ouverture1").

Indeed I would like to have for "Port Ouverture1" the value of 0 for the oldest year and then the value of "Portefeuille cloture" of the previous year. For exemple in 2016 I would like to have a "port ouverture" of 0 because its the oldest year, then in 2017 a value of 255...

For information, Portefeuille cloture is equal to "Port ouverture1"+ "Production"-"Sans effet"-"Resiliation"

 

My code right now for "Port ouverture1" is:

Exercice Civil non limité is my first columns on the first pick and it contains the years.

Minanne is a column which tells me the minimum years of my data.

I would like to add a line of code on my if statement to say that if its false then it will be equal to "portefeuille cloture" of the previous year and not of this year

 

if someone have some clue to help me it will be very nice!

Thank you!

best regards

Ps: Tell me if it's not clear.