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

Webi report formula question

HiShilpiRanjan
Explorer
0 Kudos
493

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.




View Entire Topic
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 Kudos
Thanks for your help.