Forum Discussion
Help improving nested IF statements
- 5 years ago
I think you can use a switch
Cancellation Notice Time Buckets =
SWITCH (
TRUE (),
[CancellationLeadTimeInDays] >= 92, "More than 3 months",
[CancellationLeadTimeInDays] >= 61, "2-3 months",
[CancellationLeadTimeInDays] > 30, "1-2 months",
[CancellationLeadTimeInDays] > 14, "3-4 weeks",
[CancellationLeadTimeInDays] > 7, "1-2 weeks",
[CancellationLeadTimeInDays] > 2, "Within 1 week",
[CancellationLeadTimeInDays] > 1, "Within 48 hours",
[CancellationLeadTimeInDays] >= 0, "Within 24 hours",
"After appointment"
)
That doesn't work. Instead, I get the following error message: "The value for 'CancellationLeadTimeInDays' cannot be determined. Either the column doesn't exist, or there is no current row for this column."
The column definitely exists
You need to create it as a calculated column, not a measure
- cathoms5 years agoResponsive Resident
It is not a measure. Right now CancellationLeadTimeInDays is pulled directly from our datamart in Caboodle as a numeric column in the dataset. I don't control the dataset, so I'm guessing I would need to replicate this column somehow to make it either a measure or a calculated column...
Any ideas? Thanks for your help!