J
jacky
Hi!
I got a query with 3 fields:
- Team
- Date
- Score
it looks like that:
| Team | Date | Score |
____________________
| red | 02/01/05 | 1 |
| red | 03/01/05 | 2 |
| red | 04/01/05 | 3 |
| red | 05/01/05 | 1 |
| blue | 02/01/05 | 2 |
| blue | 03/01/05 | 3 |
| blue | 04/01/05 | 4 |
| blue | 05/01/05 | 2 |
My goal is to get the Slope of the 'Score' per 'Team' during the last 3
monthes.
I use normally in Excel the Slope function, with as 'Y' the Score and
as 'X' {1;2;3}
My fisrt step was to make a more simple exemple with a table 'tabelle1'
with 2 fields:
- Y (the Score)
- X (the X value)
| Y | X |
_____________
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 2 | 4 |
I wrote this in code:
Public Function Steigung(Y As Double, X As Double)
Dim objExcel As Excel.Application
Set objExcel = New Excel.Application
Steigung = Excel.Application.WorksheetFunction.Slope(Y, X)
objExcel.Quit
Set objExcel = Nothing
End Function
and I made a querry with this expression:
Expr1: Steigung([Tabelle1]![Y];[Tabelle1]![X])
I got always the debugger! Help meeeeeeeeeeeeeeeee!!!
that was my first problem
___________________________________________________________
The second step would be to build for X an array's like (1 to number of
monthes) because I would like to define in an other table the number of
'last monthes' that will be dirfferent for each 'Team'.
Thank's for your help
I got a query with 3 fields:
- Team
- Date
- Score
it looks like that:
| Team | Date | Score |
____________________
| red | 02/01/05 | 1 |
| red | 03/01/05 | 2 |
| red | 04/01/05 | 3 |
| red | 05/01/05 | 1 |
| blue | 02/01/05 | 2 |
| blue | 03/01/05 | 3 |
| blue | 04/01/05 | 4 |
| blue | 05/01/05 | 2 |
My goal is to get the Slope of the 'Score' per 'Team' during the last 3
monthes.
I use normally in Excel the Slope function, with as 'Y' the Score and
as 'X' {1;2;3}
My fisrt step was to make a more simple exemple with a table 'tabelle1'
with 2 fields:
- Y (the Score)
- X (the X value)
| Y | X |
_____________
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 2 | 4 |
I wrote this in code:
Public Function Steigung(Y As Double, X As Double)
Dim objExcel As Excel.Application
Set objExcel = New Excel.Application
Steigung = Excel.Application.WorksheetFunction.Slope(Y, X)
objExcel.Quit
Set objExcel = Nothing
End Function
and I made a querry with this expression:
Expr1: Steigung([Tabelle1]![Y];[Tabelle1]![X])
I got always the debugger! Help meeeeeeeeeeeeeeeee!!!
that was my first problem
___________________________________________________________
The second step would be to build for X an array's like (1 to number of
monthes) because I would like to define in an other table the number of
'last monthes' that will be dirfferent for each 'Team'.
Thank's for your help