Cut off number of leave work

cut off number of leave work

The app I want is When filling out leave information and select the number of leave with leave type let it automatically deduct

such as
I have a vacation of 10 days.

  1. Code 10101 Mr. Mai Date of leave 12/12/2021 End date 13/12/2021 Number of leave 2 days Type of vacation
    When the key is finished, vacation for 10 days must be deducted for 2 days on leave, leaving 2.

I am entitled to 30 days of sick leave.
2) Code 10101 Mr. Mai Date of leave 13/12/2021 End date 13/12/2021 Number of leave 1 day Type of sick leave
When the key is finished, 30 days of sick leave must be deducted for 1 day of leave, leaving 29 left.

want to subtract Subtract the number of days followed by categorizing the number of sick leave days in this employee code, how many days are left.

0 10 299
10 REPLIES 10

Aurelien
Google Developer Expert
Google Developer Expert

Hi @fon

You may want to change your post category to โ€œQuestionโ€.
What did you try so far ? Can you share screenshot of your table structure ?

i want to make appla by deducting the amount of leave according to the type of leave

For example, if Iโ€™m on vacation, leave, and vacation privileges must be subtracted

Aurelien
Google Developer Expert
Google Developer Expert

Thanks.
I donโ€™t read any answer to my questions

This is leave information.
Main table, name, main employee (has a duty to show the code, name-surname of each person to show whoโ€™s information of it) But when adding data, add it to the secondary table only)

Secondary table, name of employee leave work (secondary table will refer to the main table)


This page will show how much leave has been awarded. and how many are left

But the table of employee leave information There will only be a page to show the number of rights that have been left. and balance

example
I got 10 vacation days.
I take 1 day leave from 12-12-2021. My vacation must be 9 days left.

But since there are many types of leave I want to calculate per status of leave type. If the leave is vacation, then the vacation is deducted, if the leave is sick leave, then the sick leave is deducted.

calculated per type

Aurelien
Google Developer Expert
Google Developer Expert

Hi @fon

Itโ€™s not exactly clear to me the way you want to perform it, but you will probably need to combine various expressions:

Here is an example of what you may want to produce. This expression will calculate the remaining days, based on 10 days for Sick leave.
You may want to make a summary โ€œper leave typeโ€ ?

IFS([vacationType]="Sick",
  10
  -SUM(
    SELECT(EmployeeLeaveTable[TotalLeave],
      AND(
        [EmployeeCode]=[_THISROW].[EmployeeCode],
        [vacationType]=[_THISROW].[vacationType],
        YEAR(TODAY())=YEAR([LeaveStartDate])
      )
    )
  ),
[vacationType]="Holidays",
  {similarCalculationForHolidaysVacationType}
)

Then take annual vacation Each person will be entitled to annual vacation differently.

How do I define it?

Aurelien
Google Developer Expert
Google Developer Expert

In

IFS([vacationType]="Sick",
  10
  -SUM(...

Replace the 10 per [EmployeeCode].[annualVacation] expression

but my type column is enum has optional like

  1. Sick leave (with the right to leave 30 days / year)
  2. Business leave (entitled to leave 8 days / year)
  3. Annual vacation leave (The number of days each person will receive is not the same)
  4. Special leave (with the right to leave 3 days / year)

[annualVacation] is not a real columnist. But itโ€™s an option in Enum. โ€ฆ

[annualVacation] Here, we have to switch to " annualVacation" instead?

Happy New Year

I still canโ€™t solve this formula.

Aurelien
Google Developer Expert
Google Developer Expert

Hi @fon

Happy new year as well.

I wonโ€™t spend more time on this thread, as you donโ€™t provide any information on what you tried so far.

As a reminder, the useful elements for your need are:

  • IFS() expression (alternatively: SWITCH())
  • SELECT() expression
  • dereference expression

Some additional tips though:

  • if some vacation type is specific to people or job: you can use dereference expression
  • if itโ€™s standard: you can use a constant value such as it is in my expression exemple with โ€œ10โ€

For reference:

Top Labels in this Space