Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to calculate the average of the percentages (for every fruit, type) as stated in the last column.
This is for Apple, type 1: (11,76%+12,33%) / 2 = 12,05%.
However, when I use the formula Avg(Aggr(Count({1} FruitID) / Count({1} Total <Date, Fruit>, FruitID), Fruit, Type)) the answer is
(56+101)/(476+819) = 12,12%.
Can somebody help me with calculating the percentages in the last column?
Thanks!
Fruit | Date | Type | Count ({FruitID}) | Count({1} Total <Date, Fruit>, FruitID) | Count({1} FruitID) / Count({1} Total <Date, Fruit>, FruitID) | Average of percentages |
---|---|---|---|---|---|---|
Apple | 25-06-2018 | 1 | 56 | 476 | 11,76% | 12,05% |
Apple | 26-06-2018 | 1 | 101 | 819 | 12,33% | 12,05% |
Apple | 25-06-2018 | 2 | 68 | 476 | 14,29% | 14,90% |
Apple | 26-06-2018 | 2 | 127 | 819 | 15,51% | 14,90% |
Apple | 25-06-2018 | 3 | 352 | 476 | 73,95% | 73,06% |
Apple | 26-06-2018 | 3 | 591 | 819 | 72,16% | 73,06% |
Banana | 25-06-2018 | 1 | 20 | 53 | 37,74% | 33,57% |
Banana | 26-06-2018 | 1 | 25 | 85 | 29,41% | 33,57% |
Banana | 25-06-2018 | 2 | 33 | 53 | 62,26% | 66,43% |
Banana | 26-06-2018 | 2 | 60 | 85 | 70,59% | 66,43% |
Try this
Avg(TOTAL <Fruit> Aggr(Count({1} FruitID)/Count({1} TOTAL <Date, Fruit> FruitID), Fruit, Date, Type))
Thank you!
This wasn't the correct answer but it helped me a lot.
The answer was:
Avg(TOTAL <Fruit, Type> Aggr(Count({1} FruitID)/Count({1} TOTAL <Date, Fruit> FruitID), Fruit, Date, Type))
Awesome, please close the thread by marking correct and helpful responses.
Best,
Sunny