Hi,
I want to caclulate the no of days an employee has been with the company so if a person has not left the company and does not have a leaving Date it should take the current date.
We have tried the following formula mentioned below but gives null result. Any pointers to solve this would help.
firstOne
vba!datediff("d",[Employee].[Joining Date].currentmember.member_value,
iif(isempty({}),
tail(descendants([Date].[FiscalHierarchy].currentmember),1).item(0).member_Value,
[Employee].[Leaving Date].currentmember.member_value))
Second
iif(
[Employee].[Leaving Date].[Leaving Date].currentmember.member_Value=NULL ,
tail(descendants([DateDay].[WeekHierarchy].currentmember),1).item(0).member_Value,
[Employee].[Leaving Date].currentmember.member_value
)
Third
vba!datediff("d",[Employee].[Joining Date].currentmember.member_value,
iif([Employee].[Leaving Date].[Leaving Date].currentmember.member_Value=NULL ,
tail(descendants([DateDay].[WeekHierarchy].currentmember),1).item(0).member_Value,
[Employee].[Leaving Date].[Leaving Date].currentmember.member_value))