Hoping for a little more help please.
I have a database which has many fields including:
Location, Date, Time, GenRate, SysData, etc.
There will be several records having the same Loc/Date/Time and different GenR/SysData etc. (sample data below).
I did some research and think I may need to use “Recordset” but I don’t really understand how to apply it.
My problem:
I need to first sort the data by Date, Time, Location, GenR (old to new, old to new, ascend, descend).
I then need to create another field, in the relevant Loc/Date/Time set, “Gen%” and populate it with a percentage which is calculated by taking the difference between Row1 GenRate and Row2 GenRate and then dividing by Row2 GenRate to show how much bigger Row 1 is over Row 2 as a percentage. Then do the same for Row 2/Row 3 etc for all the same Loc/Date/Time rows.
I have previously done this using an Excel table and the formula (on row 2 of my table) was:
=IFERROR(IF(AND(+[@Loc]=B3,[@Time]=C3,[@Date]=D3),([@GenR]-AR3)/AR3,0.01),0.01)
The IFERROR was needed to provide a nominal value for the last item in the relevant Loc/Date/Time set.
NEXT, I need to sort the data by Date, Time, Location, SysD (old to new, old to new, ascend, descend).
And then I need to repeat the steps above in a new field called “SysD%”
Thanks in advance for any suggestions.
SAMPLE DATA
Location Date Time GenRate SysData
London 01/10/2018 12:30 16 1
London 01/10/2018 12:30 11 13
London 01/10/2018 12:30 26 24
London 01/10/2018 12:30 58 62
London 01/10/2018 12:30 61 71
London 01/10/2018 12:30 65 100
Swansea 01/10/2018 13:50 37 1
Swansea 01/10/2018 13:50 64 16
Swansea 01/10/2018 13:50 47 30
Swansea 01/10/2018 13:50 83 99
Glasgow 01/10/2018 14:10 38 1
Glasgow 01/10/2018 14:10 69 7
Glasgow 01/10/2018 14:10 45 22
Swansea 01/10/2018 14:50 54 54
Swansea 01/10/2018 14:50 43 61
Swansea 01/10/2018 14:50 69 80
Swansea 01/10/2018 14:50 63 100
Swansea 01/10/2018 15:20 49 1
Swansea 01/10/2018 15:20 28 11
Swansea 01/10/2018 15:20 49 55
Glasgow 02/10/2018 14:10 58 41
Glasgow 02/10/2018 14:10 51 44
Glasgow 02/10/2018 14:10 79 99
Swansea 03/10/2018 14:50 25 1
Swansea 03/10/2018 14:50 51 37
Swansea 03/10/2018 15:20 63 90
Swansea 03/10/2018 15:20 61 100
I have a database which has many fields including:
Location, Date, Time, GenRate, SysData, etc.
There will be several records having the same Loc/Date/Time and different GenR/SysData etc. (sample data below).
I did some research and think I may need to use “Recordset” but I don’t really understand how to apply it.
My problem:
I need to first sort the data by Date, Time, Location, GenR (old to new, old to new, ascend, descend).
I then need to create another field, in the relevant Loc/Date/Time set, “Gen%” and populate it with a percentage which is calculated by taking the difference between Row1 GenRate and Row2 GenRate and then dividing by Row2 GenRate to show how much bigger Row 1 is over Row 2 as a percentage. Then do the same for Row 2/Row 3 etc for all the same Loc/Date/Time rows.
I have previously done this using an Excel table and the formula (on row 2 of my table) was:
=IFERROR(IF(AND(+[@Loc]=B3,[@Time]=C3,[@Date]=D3),([@GenR]-AR3)/AR3,0.01),0.01)
The IFERROR was needed to provide a nominal value for the last item in the relevant Loc/Date/Time set.
NEXT, I need to sort the data by Date, Time, Location, SysD (old to new, old to new, ascend, descend).
And then I need to repeat the steps above in a new field called “SysD%”
Thanks in advance for any suggestions.
SAMPLE DATA
Location Date Time GenRate SysData
London 01/10/2018 12:30 16 1
London 01/10/2018 12:30 11 13
London 01/10/2018 12:30 26 24
London 01/10/2018 12:30 58 62
London 01/10/2018 12:30 61 71
London 01/10/2018 12:30 65 100
Swansea 01/10/2018 13:50 37 1
Swansea 01/10/2018 13:50 64 16
Swansea 01/10/2018 13:50 47 30
Swansea 01/10/2018 13:50 83 99
Glasgow 01/10/2018 14:10 38 1
Glasgow 01/10/2018 14:10 69 7
Glasgow 01/10/2018 14:10 45 22
Swansea 01/10/2018 14:50 54 54
Swansea 01/10/2018 14:50 43 61
Swansea 01/10/2018 14:50 69 80
Swansea 01/10/2018 14:50 63 100
Swansea 01/10/2018 15:20 49 1
Swansea 01/10/2018 15:20 28 11
Swansea 01/10/2018 15:20 49 55
Glasgow 02/10/2018 14:10 58 41
Glasgow 02/10/2018 14:10 51 44
Glasgow 02/10/2018 14:10 79 99
Swansea 03/10/2018 14:50 25 1
Swansea 03/10/2018 14:50 51 37
Swansea 03/10/2018 15:20 63 90
Swansea 03/10/2018 15:20 61 100