
1. Re: Calculation apply dynamic value to filter results
Jim Dehner Apr 15, 2019 1:00 PM (in response to Joshua Gaffney)Joshua
sounds like you have been working the problem  please post your twbx workbook to see your approach and where you ran into problems
thanks
Jim

2. Re: Calculation apply dynamic value to filter results
Joshua Gaffney Apr 16, 2019 1:28 AM (in response to Jim Dehner)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


3. Re: Calculation apply dynamic value to filter results
Joshua Gaffney Apr 18, 2019 2:31 AM (in response to Joshua Gaffney)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 )
END 
4. Re: Calculation apply dynamic value to filter results
Ricky Walsh Apr 18, 2019 3:03 AM (in response to Joshua Gaffney)Hi Joshua,
If Category is always going to be present in the view you could try something like the below:
Category Proportion
SUM([Number of Records])/TOTAL(SUM([Number of Records]))
Benchmark Score
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
END
Risk
[Benchmark Score]*SUM([Amount])
Let me know if this isn't what you're looking for.
Ricky

JoshuaDummyDataV02.00.twbx 98.6 KB
