I want to display ranges of values as single digits. However, the code below does not work…
{Days Available} <= 30 ? 1 : ({Days Available} >= 30 && {Days Available} <= 60 ? 2 : 3)
Any help much appreciated!
I want to display ranges of values as single digits. However, the code below does not work…
{Days Available} <= 30 ? 1 : ({Days Available} >= 30 && {Days Available} <= 60 ? 2 : 3)
Any help much appreciated!
Not at my PC
- give this a try.
{Days Available} <= 30 ? 1 : ({Days Available} > 30 & {Days Available} <= 60 ? 2 : 3)
Thanks Carl! I had seen somewhere that “and” was symbolised by “&&.” Turns out it’s a single &!
Many thanks for the support!!!
If the above doesn’t work I believe it could be because the brackets / parenthesis are in the wrong place. Shouldn’t the final one be before the second question mark (to wrap the two conditions), rather than at the very end?
{Days Available} <= 30 ? 1 : ({Days Available} > 30 & {Days Available} <= 60) ? 2: 3
In fact, I don’t think you need the parenthesis at all, so it should be just:
{Days Available}<=30?1:{Days Available}>30&{Days Available}<=60?2:3
Thanks y’all for the help. This is where I ended up.
{Days to Termination} <= 0 ? 1 :{Days to Termination} > 0 & {Days to Termination} <= 30 ? 2 : {Days to Termination} > 30 & {Days to Termination} <= 60 ? 3 : {Days to Termination} > 60 & {Days to Termination} <= 90 ? 4 : 5
The problem is that your ranges overlap at 30. If you set it so that values up to 30 return 1, values between 31 and 60 return 2, and anything above 60 returns 3, it should work fine.
What a shame the same sort of IF evaluation is not available for text formulas