Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
TS08
Contributor II
Contributor II

Ageing in number of days

Hi, can anyone help me calculate ageing in days with conditions. I tried below formula but its not giving me desired result.

If([Status]='Commissioned', Today()-[Action Date])

Labels (2)
3 Solutions

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Maybe like this at the back end

IF(Match(Status,'Commissioned'),Age(now(),[Action Date])) as [Action Age]

View solution in original post

morgankejerhag
Partner - Creator III
Partner - Creator III

Are doing this calculation in a load statement in the script or are you doing in it an expression? If there several data rows for each dimension value you also need to do some aggregation like avg(if(...)). In this case it is also better to use the filter in set analysis avg({<Status={Commissioned}>} today()-[Action Date]).

This also assumes that Action Date is a true date field and not a string looking like a date.

View solution in original post

TS08
Contributor II
Contributor II
Author

Thanks, I tried this and it worked 🙂

IF(Match(Status,'Commissioned'),Age(now(),[Action Date])) as [Action Age]

Thanks once again!

View solution in original post

5 Replies
BrunPierre
Partner - Master
Partner - Master

Maybe like this at the back end

IF(Match(Status,'Commissioned'),Age(now(),[Action Date])) as [Action Age]

MarcoWedel

what is your desired result?

morgankejerhag
Partner - Creator III
Partner - Creator III

Are doing this calculation in a load statement in the script or are you doing in it an expression? If there several data rows for each dimension value you also need to do some aggregation like avg(if(...)). In this case it is also better to use the filter in set analysis avg({<Status={Commissioned}>} today()-[Action Date]).

This also assumes that Action Date is a true date field and not a string looking like a date.

TS08
Contributor II
Contributor II
Author

Thanks, I tried this and it worked 🙂

IF(Match(Status,'Commissioned'),Age(now(),[Action Date])) as [Action Age]

Thanks once again!

TS08
Contributor II
Contributor II
Author

This above solution worked for me but now I am stuck the measure I created to calcualte Ageing is not working in sync with FinMonth (Date Dimention).

I selected one Fiscal Year in Filters (April'22-March'23) however now after  applying this expression I am getting records beyong this period bcz the ageing logic is not interacting with "Fiscal Year".

Please note: the model I am using to devlope these expressions on is interactive with Date Dimetnion throuigh Measures.

Can you help me where this above formula for calcualting "Ageing" moves with Date filter.