## Maximum nested if statements

Solved
Frequent Contributor
Posts: 131

# Maximum nested if statements

Hi all,

Can anyone tell me what the maximum supported number of nested if statements is?

I'm using the parameter trick to allow users to select which variable to group by, it would be useful to know how many options I can give them, I have six currently and the calculated item formula is getting long, I want to ensure I dont stretch it too far

Accepted Solutions
Solution
‎03-08-2017 04:33 AM
Regular Contributor
Posts: 191

## Re: Maximum nested if statements

Sure,

this one directly calculates the report value related to the selected unit from the button select.

greetings

All Replies
SAS Super FREQ
Posts: 322

## Re: Maximum nested if statements

I wrote the documentation for this part of the product and am not aware of any nesting limit. If there is a limit, I'll want to know about it so I can add it to the doc.

Frequent Contributor
Posts: 131

## Re: Maximum nested if statements

Great thank you,

Will report back if I run into any issues

Regular Contributor
Posts: 191

## Re: Maximum nested if statements

Hi there,

please consider using if then else with a blank as an 'not true' answer.

now you can catenate the all the ifthenelse answers and trim them to one answer.

no nested loops, a beter overview and an endles solution.

greetings

Frequent Contributor
Posts: 131

## Re: Maximum nested if statements

Hi,

Can you give a brief example?

Solution
‎03-08-2017 04:33 AM
Regular Contributor
Posts: 191

## Re: Maximum nested if statements

Sure,

this one directly calculates the report value related to the selected unit from the button select.

greetings

Frequent Contributor
Posts: 131

## Re: Maximum nested if statements

[ Edited ]

That's a really interesting approach,

I wouldn't have attempted it this way as I would have assumed that adding 0 would have resulted in issues, it makes the formula much more readable,

I'll definitely test out switching to this syntax

Thank you

Regular Contributor
Posts: 191

## Re: Maximum nested if statements

Good to hear you have an alternative now.

Small advice, relate the buttonbar to a seperate table that only consists of the selectable options.

This way you are sure that you always have all of the options. Using a group field might give a problem here.

Anyway, maybe its good to mark your request as solved.

Greetings and good luck,   Peter

☑ This topic is solved.