Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Maximum nested if statements

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 75
Accepted Solution

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

 

ifstatement.GIF


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

Re: Maximum nested if statements

 

Sure,

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

greetings

07-03-2017 22-05-09.png

View solution in original post


All Replies
SAS Super FREQ
Posts: 274

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: 75

Re: Maximum nested if statements

Great thank you,

 

Will report back if I run into any issues

 

Regular Contributor
Posts: 172

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: 75

Re: Maximum nested if statements

Hi,

 

Can you give a brief example?

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

Re: Maximum nested if statements

 

Sure,

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

greetings

07-03-2017 22-05-09.png

Frequent Contributor
Posts: 75

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: 172

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

Post a Question
Discussion Stats
  • 7 replies
  • 286 views
  • 3 likes
  • 3 in conversation