Hi,
I'm hoping his is a relatively straight forward one and I am just missing something obvious.
I have a data table that I want to add a column to showing the total number of units for similar transactions - effectively ending up with a column showing the units for that individual transaction and one next to it (calculated) showing total units for that product. I have been playing around with various different filtering and summing options but don't seem to be getting anywhere.
The data will look something like the below...
[TABLE="width: 671"]
<tbody>[TR]
[TD]PRODUCT[/TD]
[TD]RELEASE DATE[/TD]
[TD]RECALL DATE[/TD]
[TD]START DATE[/TD]
[TD]END DATE[/TD]
[TD]PERIOD[/TD]
[TD]COUNTRY[/TD]
[TD]UNIT[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]05/11/2012[/TD]
[TD]12/11/2012[/TD]
[TD]01/11/2012[/TD]
[TD]15/11/2012[/TD]
[TD]14[/TD]
[TD]UK[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]12/11/2012[/TD]
[TD]19/11/2012[/TD]
[TD]13/11/2012[/TD]
[TD]11/12/2012[/TD]
[TD]28[/TD]
[TD]UK[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]19/11/2012[/TD]
[TD]26/11/2012[/TD]
[TD]21/11/2012[/TD]
[TD]05/12/2012[/TD]
[TD]14[/TD]
[TD]UK[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]26/11/2012[/TD]
[TD]03/12/2012[/TD]
[TD]26/11/2012[/TD]
[TD]10/12/2012[/TD]
[TD]14[/TD]
[TD]USA[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]03/12/2012[/TD]
[TD]10/12/2012[/TD]
[TD]26/11/2012[/TD]
[TD]24/12/2012[/TD]
[TD]28[/TD]
[TD]UK[/TD]
[TD]3
[/TD]
[/TR]
</tbody>[/TABLE]
So (taking the first row of data as an example) I require a column on the end of this that sums the total units in the whole data table that have a period of 14, in the UK, for product number 1. That much I can do, it is when I add in the next stage that things seem go wrong. Essentially, where the release date falls between the start and end dates that needs to be included to. Looking at the second line to elaborate on that a bit more, the calculated column would need to say that there are 3 units from that line that need to be added with 1 unit from he first line (as the end date of the first line is after the release date on he second line). Probably not explained it in the best way but hopefully that makes sense?
Basically I need to filter my table on the below and sum the units column.
- product (of current line)
- period (of current line)
- country (of current line)
- start date < recall date (of current line)
- end date >= release date (of current line)
..it is the last two that are causing the issues so any help would be greatly appreciated.
Thanks in advance for your help!
Nick
I'm hoping his is a relatively straight forward one and I am just missing something obvious.
I have a data table that I want to add a column to showing the total number of units for similar transactions - effectively ending up with a column showing the units for that individual transaction and one next to it (calculated) showing total units for that product. I have been playing around with various different filtering and summing options but don't seem to be getting anywhere.
The data will look something like the below...
[TABLE="width: 671"]
<tbody>[TR]
[TD]PRODUCT[/TD]
[TD]RELEASE DATE[/TD]
[TD]RECALL DATE[/TD]
[TD]START DATE[/TD]
[TD]END DATE[/TD]
[TD]PERIOD[/TD]
[TD]COUNTRY[/TD]
[TD]UNIT[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]05/11/2012[/TD]
[TD]12/11/2012[/TD]
[TD]01/11/2012[/TD]
[TD]15/11/2012[/TD]
[TD]14[/TD]
[TD]UK[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]12/11/2012[/TD]
[TD]19/11/2012[/TD]
[TD]13/11/2012[/TD]
[TD]11/12/2012[/TD]
[TD]28[/TD]
[TD]UK[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]19/11/2012[/TD]
[TD]26/11/2012[/TD]
[TD]21/11/2012[/TD]
[TD]05/12/2012[/TD]
[TD]14[/TD]
[TD]UK[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]26/11/2012[/TD]
[TD]03/12/2012[/TD]
[TD]26/11/2012[/TD]
[TD]10/12/2012[/TD]
[TD]14[/TD]
[TD]USA[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]03/12/2012[/TD]
[TD]10/12/2012[/TD]
[TD]26/11/2012[/TD]
[TD]24/12/2012[/TD]
[TD]28[/TD]
[TD]UK[/TD]
[TD]3
[/TD]
[/TR]
</tbody>[/TABLE]
So (taking the first row of data as an example) I require a column on the end of this that sums the total units in the whole data table that have a period of 14, in the UK, for product number 1. That much I can do, it is when I add in the next stage that things seem go wrong. Essentially, where the release date falls between the start and end dates that needs to be included to. Looking at the second line to elaborate on that a bit more, the calculated column would need to say that there are 3 units from that line that need to be added with 1 unit from he first line (as the end date of the first line is after the release date on he second line). Probably not explained it in the best way but hopefully that makes sense?
Basically I need to filter my table on the below and sum the units column.
- product (of current line)
- period (of current line)
- country (of current line)
- start date < recall date (of current line)
- end date >= release date (of current line)
..it is the last two that are causing the issues so any help would be greatly appreciated.
Thanks in advance for your help!
Nick