
1. Re: Selecting value ranges from a record count
erolst Dec 17, 2014 6:11 PM (in response to mcampa0902)Try
Let ( [
c = 22 ;
times3 = Min ( c ; 5 ) ;
times4 = Min ( c  times3 ; 5 ) ;
times5 = Min ( c  times3  times4 ; 5 ) ;
times6 = Max ( 0 ; c  15 )
] ;
times3 * 3 + times4 * 4 + times5 * 5 + times6 * 6
)
Manuel Campa Merino wrote:
If employee made 22 transactions, he gets:
…
Employee gets in total 92 points.
Actually, it's 102 …

2. Re: Selecting value ranges from a record count
erolst Dec 18, 2014 1:45 AM (in response to mcampa0902)Oops, it was late; this one's simpler:
Let ( [
c = 22 ;
times3 = Min ( c ; 5 ) ;
times4 = Min ( c  5 ; 5 ) ;
times5 = Min ( c  10 ; 5 ) ;
times6 = Max ( 0 ; c  15 )
] ;
times3 * 3 + times4 * 4 + times5 * 5 + times6 * 6
)

3. Re: Selecting value ranges from a record count
user19752 Dec 18, 2014 3:28 AM (in response to mcampa0902)Another thinking
Let ( [
c = 22 ;
times3 = c * 3 ; //every transactions get 3 points at least
times4 = Max ( c  5 ; 0 ) ; //every transactions excluding first 5 get 1point bonus
times5 = Max ( c  10 ; 0 ) ; //same as excluding first 10
times6 = Max ( c  15 ; 0 )
] ;
times3 + times4 + times5 + times6
)