ruthhacche
Board Regular
- Joined
- Sep 22, 2017
- Messages
- 84
I have a 'data' table of 190 orders that have a [DATE YearMonth] field - all 190 lines = 201908 , and a [PICK Labels] field for number of labels (only 4 lines > 0 and totalling 41 labels).
I have a 'PICKRATES' table of 60 lines of rates per month -the line for [month] = 201908 in this table has a rate of £0.28. (All other months are £0.28 also).
I have linked the tables in a many to one relationship both directions on the month - double check that if I show the month from each table there are still 190 lines (not 190 * 60) for all the orders and only 201908 is showing in the month field from both tables.
If I display the rate it is £0.28 on each line. All good.
My SQL head adds a measure as below for PICK LableCost. This works when the data is filtered for just the 4 lines that have an order the total is - 41 x £0.28 = £11.48. But if I remove the filter and show the 190 lines the total is £688.80 which is 41 x £0.28 x 60 (ie multiplied up for all months in the rate table not just 201908).
I have tried all sorts of other links and combinations and cannot get anywhere near correct. So clearly I am taking fundamentally the wrong approach, and/or the linking is wrong and/or the measure is wrong. Any help or pointers gratefully received. All I want is all 190 records coming into play and the total cost for the labels across the 190 orders to be £11.48. Then I can move on to doing the complicated bits (!!!).
I have a 'PICKRATES' table of 60 lines of rates per month -the line for [month] = 201908 in this table has a rate of £0.28. (All other months are £0.28 also).
I have linked the tables in a many to one relationship both directions on the month - double check that if I show the month from each table there are still 190 lines (not 190 * 60) for all the orders and only 201908 is showing in the month field from both tables.
If I display the rate it is £0.28 on each line. All good.
My SQL head adds a measure as below for PICK LableCost. This works when the data is filtered for just the 4 lines that have an order the total is - 41 x £0.28 = £11.48. But if I remove the filter and show the 190 lines the total is £688.80 which is 41 x £0.28 x 60 (ie multiplied up for all months in the rate table not just 201908).
I have tried all sorts of other links and combinations and cannot get anywhere near correct. So clearly I am taking fundamentally the wrong approach, and/or the linking is wrong and/or the measure is wrong. Any help or pointers gratefully received. All I want is all 190 records coming into play and the total cost for the labels across the 190 orders to be £11.48. Then I can move on to doing the complicated bits (!!!).