sounds like you have been working the problem - please post your twbx workbook to see your approach and where you ran into problems
Please see attached, I've not anything in it that has really started on this calculation. As the stuff I've tried so far is gunk that has led to a dead end.
If you want some examples of the calculations I've tried, let me know.
JoshuaDummyDataV01.00.twbx 98.7 KB
I have found a solution, however it's not very elegant as I will require a calculated field for each category. Does anyone have a more elegant solution?
IF COUNT([Category] = 'Category 1')/COUNT([Category]) > 0.05 THEN SUM( IF [Category] = 'Category 1' then [Amount] * 2 end )
Else SUM( IF [Category] = 'Category 1' then [Amount] end )
If Category is always going to be present in the view you could try something like the below:
SUM([Number of Records])/TOTAL(SUM([Number of Records]))
IF ATTR([Category]) = "Category 1" THEN
IIF([Category Proportion] > 0.05, 2, 1)
ELSEIF ATTR([Category]) = "Category 2" THEN
IIF([Category Proportion] > 0.1, 1, 0.5)
// Other Categories
Let me know if this isn't what you're looking for.
JoshuaDummyDataV02.00.twbx 98.6 KB