Example: Using AND and OR
Here are a couple of examples using AND and OR in a calculated field.
Example 1
If
(
(([Project].[Priority] = "High") OR ([Project].[Priority] = "Medium"))
AND
(([Project].[Investment Type] = "Security") OR ([Project].[Investment Type] = "Compliance")),
"Must Do Project",
"Optional Project"
)
Translated: If the project priority is High or Medium, and the Investment Type is Security or Compliance, it will return "Must Do Project". Otherwise it returns "Optional Project".
Example 2
If
(
(
(DayOfMonth ([Project].[Project Start]) = 1) OR
(DayOfMonth ([Project].[Project Start]) = 2) OR
(DayOfMonth ([Project].[Project Start]) = 3) OR
(DayOfMonth ([Project].[Project Start]) = 4) OR
(DayOfMonth ([Project].[Project Start]) = 28) OR
(DayOfMonth ([Project].[Project Start]) = 29) OR
(DayOfMonth ([Project].[Project Start]) = 30) OR
(DayOfMonth ([Project].[Project Start]) = 31)
)
AND
(
(CalendarDays([Project].[Create Date],today()))>0
),
"Project started beginning or end of the month",
"Project started in the middle of the month or project not started")
)