
1. Re: Do Not aggregate
Mattia Pradella Mar 7, 2016 7:33 PM (in response to Mattia Pradella)Thanks for your reply,
unfortunately this doesn't work as what I need is the sum of the individual numbers in the "include" statement. Is there any option to do not aggregate the "countd( [Fortnight end date])*80".
thanks.
Mattia

2. Re: Do Not aggregate
Shinichiro Murakami Mar 7, 2016 8:24 PM (in response to Mattia Pradella)I think you can simplify the calculation as below??
[Calculation1]
max(0,countd([Fortnight end date])*80  attr({include[Employeenumber]: sum([STD Hours PAID])}))
Thanks,
Shin
9.0 attached.

calculation_9.0.twbx 20.9 KB


3. Re: Do Not aggregate
Mattia Pradella Mar 7, 2016 8:47 PM (in response to Shinichiro Murakami)Hi Shin,
unfortunately it doesn't work. I've tried before with the "Attr" function but as result all the numbers turn to be 0.
I'd like to have the include function not aggregated as it is the sum of multiple individual records (it is a sum of individual gaps).
Thanks.

4. Re: Do Not aggregate
Shinichiro Murakami Mar 7, 2016 10:02 PM (in response to Mattia Pradella)Are you able to share small sample of data as packaged workbook?
Thanks,
Shin

5. Re: Do Not aggregate
Mattia Pradella Mar 7, 2016 10:33 PM (in response to Shinichiro Murakami)hi Shin, please find it attached.
the formula I'm using right now (not ideal) is B/C PAID Undertime Cycle hours fortnights.
So to do not aggregate the initial calculation I'm using a parameter.
if [Fortnights]*76 { include[EMPLOYEENUMBER]: sum([STD Hours PAID])}>0 then [Fortnights]*76 
{ include[EMPLOYEENUMBER]: sum([STD Hours PAID])}else 0
end
Have a look and let me know if you can help.
Thanks for your help.
Mattia

undertime 160308.twbx 856.6 KB


6. Re: Do Not aggregate
Shinichiro Murakami Mar 7, 2016 11:33 PM (in response to Mattia Pradella)Change LOD calc from "include" to "fixed".
and convert all the filters into "Context" to make filter effective under "Fixed".
Looks like working to me ??
[B/C PAID Undertime cycle hours fortnights 1]
max(0,{fixed:max([B/C Number of Dates])}*76
{fixed[EMPLOYEENUMBER],[DEPOT NAME]: sum([STD Hours PAID])})
[B/C Number of Dates]
{fixed [DEPOT NAME]:countd([Fortnight end date])}
Thanks,
Shin
9.0 attached.

undertime 160308_rep_9.0.twbx 884.4 KB


7. Re: Do Not aggregate
Shinichiro Murakami Mar 8, 2016 1:17 AM (in response to Shinichiro Murakami)1 of 1 people found this helpfulSorry, simply below formula works.
[B/C PAID Undertime cycle hours fortnights 1]
if {fixed:max([B/C Number of Dates])}*76 { include[EMPLOYEENUMBER]: sum([STD Hours PAID])}>0 then [Fortnights]*76 
{ include[EMPLOYEENUMBER]: sum([STD Hours PAID])}
else 0
end
[B/C Number of Dates]
{fixed [DEPOT NAME]:countd([Fortnight end date])}
Thanks,
Shin

8. Re: Do Not aggregate
Mattia Pradella Mar 8, 2016 3:14 PM (in response to Shinichiro Murakami)Hi Shin, thanks for your help!!!!
With your formula I was getting an incorrect number of shifts, In the end I got it working with the below:
if ([Number of Fortnights] )*76 { include[EMPLOYEENUMBER]: sum([STD Hours WORKED])}>0 then [Number of Fortnights]*76 
{ include[EMPLOYEENUMBER]: sum([STD Hours WORKED])}else 0
end
Number of fortnights:
{ include[DEPOT NAME]: sum([Fortnight end date])}