on 2023 Apr 10 11:58 AM
Hi All,
I am using an Advanced formula to calculate Salaries for Employees. Start and End Month are maintained as attributes of Version.
Now there are some Employees whose Hire Date is later than the Version Satrt Month. For example, Budget Start Month = 202301 while employee Hire date = 202304. So the salary for this employee should be calculated from April onwards.
To achieve this, while looping through the dates I need something like :
IF [d/Employee_ID].[p/HireMonth] <= [d/Date] THEN
//Do calculation
Endif
However this syntax is not allowed. If i try to use the Memberset property then also the syntax is not accepted.
MEMBERSET [d/Date] = [d/Version].[p/StartMonth] TO [d/Version].[p/EndMonth]
Please suggest if there is any alternate way to compare an attribute value with date.
Thanks,
Amrita
amrita_g_pwc
You have to use DATEDIFF to build the logic. Something like below to check if employee hire date is less than version end date
IF DATEDIFF([d/Employee_ID].[p/HireMonth],[d/Version].[p/EndMonth], "MONTH") >= 0 THEN
DATA()
ENDIF
OR
MEMBERSET [d/Date] = [d/Version].[p/StartMonth] TO [d/Version].[p/EndMonth]
IF DATEDIFF([d/Employee_ID].[p/HireMonth], [d/Date], "MONTH") >= 0
DATE()
ENDIF
The above are just checking that Employee hire date falls within Budget start and end date
Hope this helps
Please upvote/accept if this helps you.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
9 | |
8 | |
8 | |
7 | |
7 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.