In Advanced Analytics, you can use dimensions (non-numeric fields) in CASE statements.
The syntax can be a bit unintuitive because these fields normally aren’t supported in such formulas. The workaround is to self-reference the dimension through a COUNT or MAX function and apply in-formula filters.
Examples:
You want to add a multiplier to a revenue column depending on the value entered in a project custom field:
CASE
WHEN MAX([Project Custom Field ]) = (MAX([Project Custom Field]),[Project Custom Field 1])
THEN SUM([Total Project Plan Revenue]) * 0.5
WHEN MAX([Project Custom Field ]) = (MAX([Project Custom Field]),[Project Custom Field 2])
THEN SUM([Total Project Plan Revenue]) * 0.75
WHEN MAX([Project Custom Field ]) = (MAX([Project Custom Field]),[Project Custom Field 3])
THEN SUM([Total Project Plan Revenue]) * 0.9
ELSE [Total Project Plan Revenue]
END
On each line, the third instance of [Project Custom Field] must be filtered to a specific value. To adjust this filter, click on the field within the formula and select Edit filter.
You want a graph that shows a line with absolute values that vary depending on the month:
CASE
WHEN COUNT([Months in Date]) = (COUNT([Months in Date]),[Months in Date1]) THEN 191000
WHEN COUNT([Months in Date]) = (COUNT([Months in Date]),[Months in Date2]) THEN 210000
WHEN COUNT([Months in Date]) = (COUNT([Months in Date]),[Months in Date3]) THEN 180000
WHEN COUNT([Months in Date]) = (COUNT([Months in Date]),[Months in Date4]) THEN 220000
ELSE 200000
END
On each line, the third instance of [Months in Date] must be filtered to a specific month. To adjust this filter, click on the field name thin the formula and select Edit filter.
Comments
0 comments
Please sign in to leave a comment.