Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to use the AddYears function in a dimension (column of a table), but not with a static n-value that indicate the years to add or subtract.
One of the Columns indicate the Depreciation Year. In order to indicate the depreciation years I had to do the following: AGGR(ONLY ({<[Attribute Code]={'DEPRECIATION YEARS'}>} [Attribute Value]),[Asset Code])) this provides a number, e.g. 4
I now what to use that value in another column to indicate the Remaining Depreciation Year. I wanted to do the following: AddYears([Commissioned On Date] , AGGR(ONLY ({<[Attribute Code]={'DEPRECIATION YEARS'}>} [Attribute Value]),[Asset Code])) . This does however not work.
When I do the following: AddYears([Commissioned On Date] , 4) I get the answer I am looking for, but the n-value of the AddYears value will be dynamic for each Asset that is in the table.
Thanks is advance
Marisa
Hi
What about creating a variable with you mesure to calculate the depreciate year
And then use this variable in your addyear mesure
variable :
vDepreciate_Year = AGGR(ONLY ({<[Attribute Code]={'DEPRECIATION YEARS'}>} [Attribute Value]),[Asset Code]))
mesure :
AddYears([Commissioned On Date] ,$(vDepreciate_Year ) )
Hope it helps
Hi
What about creating a variable with you mesure to calculate the depreciate year
And then use this variable in your addyear mesure
variable :
vDepreciate_Year = AGGR(ONLY ({<[Attribute Code]={'DEPRECIATION YEARS'}>} [Attribute Value]),[Asset Code]))
mesure :
AddYears([Commissioned On Date] ,$(vDepreciate_Year ) )
Hope it helps
Thanks for the reply.
I have tried that now, but I am still not getting an answer.
Thank you so much. At first it did not work, but that was because the Depreciate_Year was seen as text and not a number. I just added num# in front of it and it work.
Thanks again
Marisa