cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Webi report formula question

HiShilpiRanjan
Explorer
0 Likes
595

Hi All,

Need your help to solve a query.

I have 4 columns in webi report need calculation as below:

Week no.Total approved OT hrsProductive Normal OT allowanceOT allowanceUnpaid Overtime Hrs
week 120 hrs5.5 hrs122.5
     
     
     
01-Oct-233 hrs300
02-Oct-230 hrs000
03-Oct-233 hrs2.50.50
04-Oct-234 hrs040
05-Oct-232 hrs020
06-Oct-230 hrs000
07-Oct-238 hrs05.52.5
  5.512 

The "Total approved OT hrs" is the 2nd column whose values are coming from Database.
"Productive Normal OT allowance" 3rd column can be maximum 5.5 hrs each week.
"OT allowance" 4th column can be maximum 12 hrs each week.
Unpaid OT hours will have the rest hrs that is sum(The Total approved OT hrs in every week)-12.

Thank you in advance.




Accepted Solutions (0)

Answers (2)

Answers (2)

ayman_salem
Active Contributor

It was a challenge, and here's how to solve it

Define the following variables:

v_WeekNo
=Week([Date])

v_MaxAllowProdNormalOT
=5.5

v_MaxAllowOT
=12

v_tmp1
=Previous([v_MaxAllowProdNormalOT]-RunningSum([Total approved OT hrs]; ([v_WeekNo]));([v_WeekNo]))

v_tmp2
=Previous([v_MaxAllowOT]-RunningSum(([Total approved OT hrs] - [v_AllowProdNormalOT]);([v_WeekNo]));([v_WeekNo]))

v_AllowProdNormalOT
= If(IsNull([v_tmp1])) Then ([Total approved OT hrs]) ElseIf ([Total approved OT hrs] = 0 Or [v_tmp1] < 0) Then 0 ElseIf ([v_tmp1] > [Total approved OT hrs]) Then [Total approved OT hrs] Else [v_tmp1]

v_AllowOT
= If(IsNull([v_tmp2])) Then ([Total approved OT hrs] - [v_AllowProdNormalOT]) ElseIf ([Total approved OT hrs] = 0 Or [v_tmp2] < 0) Then 0 ElseIf ([v_tmp2] > [Total approved OT hrs] - [v_AllowProdNormalOT]) Then ([Total approved OT hrs] - [v_AllowProdNormalOT]) Else [v_tmp2]

v_UnpaidOvertime
=[Total approved OT hrs]-([v_AllowProdNormalOT]+[v_AllowOT])

B_20240212.JPG

B_20240212_0.JPG

Note: The table must be sorted by “Date”.

.......

I hope it helps

 

 

 

 

HiShilpiRanjan
Explorer
0 Likes
Thanks for your help.
HiShilpiRanjan
Explorer
0 Likes

Posting some more details for the same question:
The excel attached has 5 columns.
The left two columns data are coming from Database.
The right 3 columns need to be derived based on logic mentioned below:

Logic for the 3 Derived columns:

1> Productive Normal OT allowance(max 5.5 hrs in a week):
maximum 5.5 hours allowed in a week for a employee


2> OT allowance(max 12 hrs in a week):
maximum 12 hours allowed in a week for a employee


3> Unpaid Overtime hrs:

Lets say
Total approved OT (hrs) in a week (1st Jan to 7th Jan)for a employee =18 hrs
Productive Normal OT allowance(max 5.5 hrs in a week)= 5.5 hrs
OT allowance(max 12 hrs in a week)=12 hrs
Unpaid Overtime hrs= 18-5.5-12 = 0.5 hrs

I will be applying Break on Weeks, however need some way to derive the logic for right 3 columns.

Can anyone please suggest.
Thanks in advance..