Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Split rows based on condition

Hi Community,

 

Hope everyone is doing well.

 

I'm struggling to split rows based on condition. Following is the format of data;

Employee CodeLeave Start DateLeave End DateHoursPeriod End Datestart weekDays diffNet work days
9385/10/202023/10/20207523/10/2020411815
88418/12/20201/01/202137.51/01/2021511411
2055/04/202119/04/202167/05/2021151411
4985/12/202018/12/20207518/12/2020491310
4987/11/202020/11/20207520/11/2020451310

 

I want to put a condition on days diff as follows;

 

Daysdiff > 14 = 3 rows

Daysdiff > 7 = 2 rows

Daydiff < 7 = 1 row

 

with the split, I need two columns such as "Start of week" and "Apportioned hours"

 

Following is what I expect to see as the result;

 

Employee CodeLeave Start DateLeave End DateHoursPeriod End Datestart weekDays diffNet work daysApportioned hoursStart of week
9385/10/202023/10/20207523/10/2020411815255/10/2020
9385/10/202023/10/20207523/10/20204118152512/10/2020
9385/10/202023/10/20207523/10/20204118152519/10/2020

 

Any help with this is highly appreciated.

 

Thank you in advance

 

Best regards,

Ashan

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi wdx223_Daniel,

       

      Thank you so much for your solution. Can you please explain what you have done to get results

       

      Best regards,

      Ashan.

      • wdx223_Daniel's avatar
        wdx223_Daniel
        Icon for Community Champion rankCommunity Champion

        all codes have been shown, i do not know how to explain further.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi wdx223_Daniel,

       

      Can you please let me know the change in code if there is a text column such as employee name?

       

      Best Regards,

      Ashan.